Commit b23c8bab authored by Itamar Haber's avatar Itamar Haber
Browse files

Uses an offset in addReplyHelp

parent 8b511219
...@@ -604,19 +604,17 @@ void addReplyHelp(client *c, const char **help) { ...@@ -604,19 +604,17 @@ void addReplyHelp(client *c, const char **help) {
sds cmd = sdsnew((char*) c->argv[0]->ptr); sds cmd = sdsnew((char*) c->argv[0]->ptr);
void *blenp = addDeferredMultiBulkLength(c); void *blenp = addDeferredMultiBulkLength(c);
int blen = 0; int blen = 0;
int hlen = 0;
sdstoupper(cmd); sdstoupper(cmd);
addReplyStatusFormat(c, addReplyStatusFormat(c,
"%s <subcommand> arg arg ... arg. Subcommands are:",cmd); "%s <subcommand> arg arg ... arg. Subcommands are:",cmd);
blen++;
sdsfree(cmd); sdsfree(cmd);
while (help[hlen]) { while (help[blen]) {
addReplyStatus(c,help[hlen++]); addReplyStatus(c,help[blen++]);
blen++;
} }
blen += 1; /* Account for the header line(s). */
setDeferredMultiBulkLength(c,blenp,blen); setDeferredMultiBulkLength(c,blenp,blen);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment