X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/5d08193126df54405dae3073c62b7c19ae03d1a4..c47d152c8d96415de1af994b1a4bb3e0347caef3:/src/util.c diff --git a/src/util.c b/src/util.c index 5712241b..f5a23af2 100644 --- a/src/util.c +++ b/src/util.c @@ -1,9 +1,11 @@ +#include "fmacros.h" #include #include #include #include #include #include + #include "util.h" /* Glob-style pattern matching. */ @@ -336,6 +338,14 @@ void test_string2ll(void) { strcpy(buf,"+1"); assert(string2ll(buf,strlen(buf),&v) == 0); + /* Leading space. */ + strcpy(buf," 1"); + assert(string2ll(buf,strlen(buf),&v) == 0); + + /* Trailing space. */ + strcpy(buf,"1 "); + assert(string2ll(buf,strlen(buf),&v) == 0); + /* May not start with 0. */ strcpy(buf,"01"); assert(string2ll(buf,strlen(buf),&v) == 0);