From 53418c8467e0e0845e8f9875fccf05a6cc5a4684 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Fri, 3 May 2013 05:40:41 -0400 Subject: [PATCH] Rework how we look at args. --- clients/memcp.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clients/memcp.cc b/clients/memcp.cc index f3c31141..7986e248 100644 --- a/clients/memcp.cc +++ b/clients/memcp.cc @@ -85,6 +85,13 @@ int main(int argc, char *argv[]) { options_parse(argc, argv); + + if (optind >= argc) + { + fprintf(stderr, "Expected argument after options\n"); + exit(EXIT_FAILURE); + } + initialize_sockets(); memcached_st *memc= memcached_create(NULL); @@ -129,10 +136,12 @@ int main(int argc, char *argv[]) { opt_servers= strdup(temp); } +#if 0 else if (argc >= 1 and argv[--argc]) { opt_servers= strdup(argv[argc]); } +#endif if (opt_servers == NULL) { -- 2.30.2