Commit 1daee8c7 authored by antirez's avatar antirez
Browse files

string2ll(): test for NULL pointer in all the cases.

parent 9a375e54
...@@ -369,7 +369,7 @@ int string2ll(const char *s, size_t slen, long long *value) { ...@@ -369,7 +369,7 @@ int string2ll(const char *s, size_t slen, long long *value) {
v = p[0]-'0'; v = p[0]-'0';
p++; plen++; p++; plen++;
} else if (p[0] == '0' && slen == 1) { } else if (p[0] == '0' && slen == 1) {
*value = 0; if (value != NULL) *value = 0;
return 1; return 1;
} else { } else {
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment