From: Adam Dickmeiss Date: Fri, 4 Dec 2009 11:29:47 +0000 (+0100) Subject: zoomsh: Refactor command show X-Git-Tag: v4.0.0~84 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=7dbee1f341772642df14925d639f03aec2eb3355;p=yaz-moved-to-github.git zoomsh: Refactor command show --- diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 01c8e1a..2c93b6e 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -168,12 +168,12 @@ static void cmd_close(ZOOM_connection *c, ZOOM_resultset *r, static void display_records(ZOOM_connection c, ZOOM_resultset r, - int start, int count, const char *type) + size_t start, size_t count, const char *type) { - int i; - for (i = 0; i= 0) - ZOOM_options_set(options, "start", start_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; + { + char start_str[30], count_str[30]; + if (next_token_copy(args, start_str, sizeof(start_str)) > 0) + start = atoi(start_str); + + if (next_token_copy(args, count_str, sizeof(count_str)) > 0) + count = atoi(count_str); + + if (next_token_copy(args, render_str, sizeof(render_str)) > 0) + type = render_str; + } - for (i = 0; i