Uses an offset in addReplyHelp

This commit is contained in:
Itamar Haber 2017-12-05 18:17:14 +02:00
parent 8b51121998
commit b23c8babed

View File

@ -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);
} }