Fix for lp:1123153 (poor use of strtol).
[awesomized/libmemcached] / clients / ms_conn.c
index 2cbc7e0b384acbae901aae90c42656d969eb5981..2afc9fa10f029dc4a3b477317516a5f9ee408fff 100644 (file)
@@ -1160,7 +1160,12 @@ static int ms_ascii_process_line(ms_conn_t *c, char *command)
     {
       token_t tokens[MAX_TOKENS];
       ms_tokenize_command(command, tokens, MAX_TOKENS);
+      errno= 0;
       value_len= strtol(tokens[VALUELEN_TOKEN].value, NULL, 10);
+      if (errno != 0)
+      {
+        printf("<%d ERROR %s\n", c->sfd, strerror(errno));
+      }
       c->currcmd.key_prefix= *(uint64_t *)tokens[KEY_TOKEN].value;
 
       /*