summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-12-10 12:31:10 +0100
committerantirez <antirez@gmail.com>2018-12-21 11:42:52 +0100
commitb1f4203afddca8c70557e3e71073f2c75f02fb6f (patch)
tree2cb3332d911e6af0647f25e4cff844ce14e85dc5
parenta918ad054524e2a73c284a3b511b60b381213584 (diff)
downloadredis-b1f4203afddca8c70557e3e71073f2c75f02fb6f.tar.gz
RESP3: DEBUG PROTOCOL: fix strcasecmp() check.
-rw-r--r--src/debug.c20
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);