Commit 4f742bd6 authored by antirez's avatar antirez
Browse files

string2ll(): remove duplicated check for special case.

Related to #5157. The PR author correctly indentified that the check was
duplicated, but removing the second one introduces a bug that was fixed
in the past (hence the duplication). Instead we can remove the first
instance of the check without issues.
parent a4efac00
......@@ -349,12 +349,7 @@ int string2ll(const char *s, size_t slen, long long *value) {
if (plen == slen)
return 0;
/* Special case: first and only digit is 0. */
if (slen == 1 && p[0] == '0') {
if (value != NULL) *value = 0;
return 1;
}
/* Handle negative integers. */
if (p[0] == '-') {
negative = 1;
p++; plen++;
......
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