This fixes the overflow size_t possible problem in the string functions (yes,
[awesomized/libmemcached] / src / memrm.c
index b8d07ba4afa6d92a0f23947068fc0b267415177c..acfbf53fd9bf62d60eb176bc1f9397773c141d74 100644 (file)
@@ -2,6 +2,7 @@
 #include <unistd.h>
 #include <getopt.h>
 #include <memcached.h>
+#include <string.h>
 #include "client_options.h"
 #include "utilities.h"
 
@@ -47,8 +48,11 @@ int main(int argc, char *argv[])
 
     if (rc != MEMCACHED_SUCCESS) 
     {
-      fprintf(stderr, "memrm: %s: memcache error %s\n", 
+      fprintf(stderr, "memrm: %s: memcache error %s", 
              argv[optind], memcached_strerror(memc, rc));
+      if (memc->my_errno)
+       fprintf(stderr, " system error %s", strerror(memc->my_errno));
+      fprintf(stderr, "\n");
     }
 
     optind++;