X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemping.cc;h=39546d4f660be95d4bf994a8c6bf731e332c802f;hb=9763b8e9b681d1d6713b95e4d7ce6ffeafeafca5;hp=bcc07cd3921397661ad44941a4cf9d2ec4c32a42;hpb=956d15b5b1f3f3518eb374a3a9e0393e9dacd3b6;p=awesomized%2Flibmemcached diff --git a/clients/memping.cc b/clients/memping.cc index bcc07cd3..39546d4f 100644 --- a/clients/memping.cc +++ b/clients/memping.cc @@ -1,4 +1,5 @@ /* LibMemcached + * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * @@ -8,14 +9,16 @@ * Summary: * */ -#include "config.h" +#include "mem_config.h" -#include -#include -#include +#include +#include +#include #include -#include -#include +#include + +#include +#include #include "client_options.h" #include "utilities.h" @@ -138,11 +141,18 @@ void options_parse(int argc, char *argv[]) break; case OPT_EXPIRE: /* --expire */ - opt_expire= (time_t)strtoll(optarg, (char **)NULL, 10); + errno= 0; + opt_expire= time_t(strtoll(optarg, (char **)NULL, 10)); + if (errno != 0) + { + std::cerr << "Incorrect value passed to --expire: `" << optarg << "`" << std::cerr; + exit(EXIT_FAILURE); + } break; case OPT_USERNAME: opt_username= optarg; + opt_binary= true; break; case OPT_PASSWD: