From 7dbee1f341772642df14925d639f03aec2eb3355 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 4 Dec 2009 12:29:47 +0100 Subject: [PATCH] zoomsh: Refactor command show --- zoom/zoomsh.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) 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