X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=zoom%2Fzoomsh.c;h=01c8e1aaefd511e13797bda5b5afb5574d9c77bc;hb=5207f60678397943900b4e5f41d563335bf745d1;hp=73d94bddf2527e8a472c1c86f12cb0517cc7083e;hpb=6d60541cbd1b81b23872214ad2d8ea11a54544ac;p=yaz-moved-to-github.git diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 73d94bd..01c8e1a 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -12,8 +12,6 @@ #include #include -#include - #if HAVE_READLINE_READLINE_H #include #endif @@ -21,10 +19,7 @@ #include #endif -#include - #include -#include #include #define MAX_CON 100 @@ -235,8 +230,9 @@ static void cmd_show(ZOOM_connection *c, ZOOM_resultset *r, if (next_token_copy(args, start_str, sizeof(start_str)) >= 0) ZOOM_options_set(options, "start", start_str); - if (next_token_copy(args, count_str, sizeof(count_str)) >= 0) - ZOOM_options_set(options, "count", count_str); + if (next_token_copy(args, count_str, sizeof(count_str)) <= 0) + strcpy(count_str, "1"); + ZOOM_options_set(options, "count", count_str); if (next_token_copy(args, render_str, sizeof(render_str)) >= 0) type = render_str; @@ -381,8 +377,8 @@ static void cmd_search(ZOOM_connection *c, ZOOM_resultset *r, int start = ZOOM_options_get_int(options, "start", 0); int count = ZOOM_options_get_int(options, "count", 0); - printf("%s: %ld hits\n", ZOOM_connection_option_get(c[i], "host"), - (long) ZOOM_resultset_size(r[i])); + printf("%s: %lld hits\n", ZOOM_connection_option_get(c[i], "host"), + (long long int) ZOOM_resultset_size(r[i])); /* and display */ display_records(c[i], r[i], start, count, "render"); } @@ -438,12 +434,11 @@ static void cmd_scan(ZOOM_connection *c, ZOOM_resultset *r, size_t p, sz = ZOOM_scanset_size(s[i]); for (p = 0; p < sz; p++) { - int occ = 0; - int len = 0; + size_t occ = 0; + size_t len = 0; const char *term = ZOOM_scanset_display_term(s[i], p, &occ, &len); - - printf("%.*s %d\n", len, term, occ); + printf("%.*s %lld\n", (int) len, term, (long long int) occ); } ZOOM_scanset_destroy(s[i]); }