diff options
author | antirez <antirez@gmail.com> | 2018-12-10 12:31:10 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-01-09 17:00:30 +0100 |
commit | 4e2dd54df0a0fc305024a0b0df9d8a604ab7f6e1 (patch) | |
tree | cae5fe860533ec0bfb4d2d5935a11e01ebc7b9fa /src/debug.c | |
parent | 795ad670f9f3e2c09f8fb4c26b11a080def4420e (diff) | |
download | redis-4e2dd54df0a0fc305024a0b0df9d8a604ab7f6e1.tar.gz |
RESP3: DEBUG PROTOCOL: fix strcasecmp() check.
Diffstat (limited to 'src/debug.c')
-rw-r--r-- | src/debug.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/debug.c b/src/debug.c index c9435e720..d43dcc97a 100644 --- a/src/debug.c +++ b/src/debug.c @@ -533,26 +533,26 @@ NULL /* DEBUG PROTOCOL [string|integer|double|bignum|null|array|set|map| * attrib|push|verbatim|true|false|state|err|bloberr] */ char *name = c->argv[2]->ptr; - if (strcasecmp(name,"string")) { + if (!strcasecmp(name,"string")) { addReplyBulkCString(c,"Hello World"); - } else if (strcasecmp(name,"integer")) { + } else if (!strcasecmp(name,"integer")) { addReplyLongLong(c,12345); - } else if (strcasecmp(name,"double")) { + } else if (!strcasecmp(name,"double")) { addReplyDouble(c,3.14159265359); - } else if (strcasecmp(name,"bignum")) { + } else if (!strcasecmp(name,"bignum")) { addReplyString(c,"(1234567999999999999999999999999999999\r\n",40); - } else if (strcasecmp(name,"null")) { + } else if (!strcasecmp(name,"null")) { addReplyNull(c); - } else if (strcasecmp(name,"array")) { + } else if (!strcasecmp(name,"array")) { addReplyArrayLen(c,3); for (int j = 0; j < 3; j++) addReplyLongLong(c,j); - } else if (strcasecmp(name,"set")) { + } else if (!strcasecmp(name,"set")) { addReplySetLen(c,3); for (int j = 0; j < 3; j++) addReplyLongLong(c,j); - } else if (strcasecmp(name,"map")) { + } else if (!strcasecmp(name,"map")) { addReplyMapLen(c,3); for (int j = 0; j < 3; j++) addReplyLongLong(c,j); - } else if (strcasecmp(name,"attrib")) { + } else if (!strcasecmp(name,"attrib")) { addReplyAttributeLen(c,1); addReplyBulkCString(c,"key-popularity"); addReplyArrayLen(c,2); @@ -561,7 +561,7 @@ NULL /* Attributes are not real replies, so a well formed reply should * also have a normal reply type after the attribute. */ addReplyBulkCString(c,"Some real reply following the attribute"); - } else if (strcasecmp(name,"push")) { + } else if (!strcasecmp(name,"push")) { addReplyPushLen(c,2); addReplyBulkCString(c,"server-cpu-usage"); addReplyLongLong(c,42); |