X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemslap.cc;h=e66ab0fd584dbba094d675e55ef127b5083680e3;hb=0b262a1571e2196e988a841d3449b5a4e0a2081a;hp=d32b1c040e79b6e686506dd3d06f011ae8b11c20;hpb=17690735658d7b44f91579df91e31da9ae185158;p=awesomized%2Flibmemcached diff --git a/clients/memslap.cc b/clients/memslap.cc index d32b1c04..e66ab0fd 100644 --- a/clients/memslap.cc +++ b/clients/memslap.cc @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -50,7 +51,6 @@ #include #include #include -#include #include #include @@ -468,15 +468,33 @@ void options_parse(int argc, char *argv[]) break; case OPT_SLAP_CONCURRENCY: + errno= 0; opt_concurrency= (unsigned int)strtoul(optarg, (char **)NULL, 10); + if (errno != 0) + { + fprintf(stderr, "Invalid value for concurrency: %s\n", optarg); + exit(EXIT_FAILURE); + } break; case OPT_SLAP_EXECUTE_NUMBER: + errno= 0; opt_execute_number= (unsigned int)strtoul(optarg, (char **)NULL, 10); + if (errno != 0) + { + fprintf(stderr, "Invalid value for execute: %s\n", optarg); + exit(EXIT_FAILURE); + } break; case OPT_SLAP_INITIAL_LOAD: + errno= 0; opt_createial_load= (unsigned int)strtoul(optarg, (char **)NULL, 10); + if (errno != 0) + { + fprintf(stderr, "Invalid value for initial load: %s\n", optarg); + exit(EXIT_FAILURE); + } break; case OPT_QUIET: