]> git.saurik.com Git - redis.git/blobdiff - redis-cli.c
Version changed to 1.3.0, welcome to the new unstable
[redis.git] / redis-cli.c
index e9f95c14d840348bae922bbff4be26394a6f4bc8..ca1b581bd09fc80e6e8af868dfbeb3b8cfeccdad 100644 (file)
@@ -42,7 +42,7 @@
 
 #define REDIS_CMD_INLINE 1
 #define REDIS_CMD_BULK 2
-#define REDIS_CMD_MULTIBULK 3
+#define REDIS_CMD_MULTIBULK 4
 
 #define REDIS_NOTUSED(V) ((void) V)
 
@@ -96,9 +96,9 @@ static struct redisCommand cmdTable[] = {
     {"zincrby",4,REDIS_CMD_BULK},
     {"zrem",3,REDIS_CMD_BULK},
     {"zremrangebyscore",4,REDIS_CMD_INLINE},
-    {"zrange",4,REDIS_CMD_INLINE},
-    {"zrangebyscore",4,REDIS_CMD_INLINE},
-    {"zrevrange",4,REDIS_CMD_INLINE},
+    {"zrange",-4,REDIS_CMD_INLINE},
+    {"zrangebyscore",-4,REDIS_CMD_INLINE},
+    {"zrevrange",-4,REDIS_CMD_INLINE},
     {"zcard",2,REDIS_CMD_INLINE},
     {"zscore",3,REDIS_CMD_BULK},
     {"incrby",3,REDIS_CMD_INLINE},
@@ -311,7 +311,8 @@ static int cliSendCommand(int argc, char **argv) {
         if (rc->flags & REDIS_CMD_MULTIBULK) {
             cmd = sdscatprintf(cmd,"*%d\r\n",argc);
             for (j = 0; j < argc; j++) {
-                cmd = sdscatprintf(cmd,"$%d\r\n",sdslen(argv[j]));
+                cmd = sdscatprintf(cmd,"$%lu\r\n",
+                    (unsigned long)sdslen(argv[j]));
                 cmd = sdscatlen(cmd,argv[j],sdslen(argv[j]));
                 cmd = sdscatlen(cmd,"\r\n",2);
             }
@@ -319,7 +320,8 @@ static int cliSendCommand(int argc, char **argv) {
             for (j = 0; j < argc; j++) {
                 if (j != 0) cmd = sdscat(cmd," ");
                 if (j == argc-1 && rc->flags & REDIS_CMD_BULK) {
-                    cmd = sdscatprintf(cmd,"%d",sdslen(argv[j]));
+                    cmd = sdscatprintf(cmd,"%lu",
+                        (unsigned long)sdslen(argv[j]));
                 } else {
                     cmd = sdscatlen(cmd,argv[j],sdslen(argv[j]));
                 }