summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfilipecosta90 <filipecosta.90@gmail.com>2019-09-25 17:28:42 +0100
committerfilipecosta90 <filipecosta.90@gmail.com>2019-09-25 17:28:42 +0100
commitaf15b285faa2a9cece8f5a76e05221836b6abae5 (patch)
treed095f39296a68b230918c6fc3e77c8e4598379b4
parent733280d9cb1122dd15440429137610a4237869d4 (diff)
downloadredis-af15b285faa2a9cece8f5a76e05221836b6abae5.tar.gz
[fix] fixed the un-refactor bug.
-rw-r--r--src/module.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c
index 067a69928..d02e2708c 100644
--- a/src/module.c
+++ b/src/module.c
@@ -1126,9 +1126,10 @@ int RM_ReplyWithLongLong(RedisModuleCtx *ctx, long long ll) {
int replyWithStatus(RedisModuleCtx *ctx, const char *msg, char *prefix) {
client *c = moduleGetReplyClient(ctx);
if (c == NULL) return REDISMODULE_OK;
- const size_t len = strlen(msg);
- addReplyProto(c,"-",1);
- addReplyProto(c,msg,len);
+ const size_t msgLen = strlen(msg);
+ const size_t prefixLen = strlen(prefix);
+ addReplyProto(c,prefix,prefixLen);
+ addReplyProto(c,msg,msgLen);
addReplyProto(c,"\r\n",2);
return REDISMODULE_OK;
}