libmemcached-1.0: fix subscripting on empty vector
[awesomized/libmemcached] / clients / memcp.cc
index 7aa805f95865a019e9c982816c8d704397bd33cc..d76faeecca8d31da36e6f23d2ebec9a3e1ea813d 100644 (file)
@@ -1,5 +1,5 @@
 /* LibMemcached
- * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
+ * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/
  * Copyright (C) 2006-2009 Brian Aker
  * All rights reserved.
  *
@@ -68,13 +68,13 @@ static long strtol_wrapper(const char *nptr, int base, bool *error)
       or (errno != 0 && val == 0))
   {
     *error= true;
-    return EXIT_SUCCESS;
+    return 0;
   }
 
   if (endptr == nptr)
   {
     *error= true;
-    return EXIT_SUCCESS;
+    return 0;
   }
 
   *error= false;
@@ -385,10 +385,10 @@ static void options_parse(int argc, char *argv[])
     case OPT_EXPIRE: /* --expire */
       {
         bool strtol_error;
-        opt_expires= (time_t)strtol_wrapper(optarg, 16, &strtol_error);
+        opt_expires= (time_t)strtol_wrapper(optarg, 10, &strtol_error);
         if (strtol_error == true)
         {
-          fprintf(stderr, "Bad value passed via --flag\n");
+          fprintf(stderr, "Bad value passed via --expire\n");
           exit(1);
         }
       }