]> git.saurik.com Git - redis.git/commitdiff
c->bufpos initialization moved for aesthetics.
authorantirez <antirez@gmail.com>
Tue, 13 Mar 2012 11:59:27 +0000 (12:59 +0100)
committerantirez <antirez@gmail.com>
Tue, 13 Mar 2012 17:08:43 +0000 (18:08 +0100)
src/networking.c

index 40aad83606a7a7a23b37f7abd81e7672db527257..14c5dcce6248233afbf52185c832c18be650dc47 100644 (file)
@@ -22,7 +22,6 @@ int listMatchObjects(void *a, void *b) {
 
 redisClient *createClient(int fd) {
     redisClient *c = zmalloc(sizeof(redisClient));
-    c->bufpos = 0;
 
     /* passing -1 as fd it is possible to create a non connected client.
      * This is useful since all the Redis commands needs to be executed
@@ -42,6 +41,7 @@ redisClient *createClient(int fd) {
 
     selectDb(c,0);
     c->fd = fd;
+    c->bufpos = 0;
     c->querybuf = sdsempty();
     c->reqtype = 0;
     c->argc = 0;