From: Mark Atwood Date: Mon, 24 Sep 2007 20:30:55 +0000 (-0700) Subject: fix bug, trying to walk off the end of the argv array X-Git-Tag: 0.2~7^2~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=303249cf77cfb88dff064a15cc422318aa091ea4;p=m6w6%2Flibmemcached fix bug, trying to walk off the end of the argv array --- diff --git a/src/memcat.c b/src/memcat.c index 924b16d8..d3360676 100644 --- a/src/memcat.c +++ b/src/memcat.c @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) if (opt_servers) parse_opt_servers(memc, opt_servers); - while (optind <= argc) + while (optind < argc) { string= memcached_get(memc, argv[optind], strlen(argv[optind]), &string_length, &flags, &rc); diff --git a/src/memrm.c b/src/memrm.c index 1fa9f409..18f53a5e 100644 --- a/src/memrm.c +++ b/src/memrm.c @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) if (opt_servers) parse_opt_servers(memc, opt_servers); - while (optind <= argc) + while (optind < argc) { if (opt_verbose) printf("key: %s\nexpires: %llu\n", argv[optind], (unsigned long long)opt_expire);