]> git.saurik.com Git - redis.git/blobdiff - src/util.c
Merge branch 'unstable' of github.com:antirez/redis into unstable
[redis.git] / src / util.c
index 5712241b15df9748c9114512b335e4e7611a35ba..e83dbeddc0e856b4e6a2bfeef72c17e7965b6b6e 100644 (file)
@@ -336,6 +336,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);