Eliminate snprintf usage at setDeferredAggregateLen (#1234)
to align with how we encode the length at `_addReplyLongLongWithPrefix` Signed-off-by: Masahiro Ide <masahiro.ide@lycorp.co.jp> Co-authored-by: Masahiro Ide <masahiro.ide@lycorp.co.jp>
This commit is contained in:
parent
ab98f375db
commit
91cbf77442
@ -888,8 +888,11 @@ void setDeferredAggregateLen(client *c, void *node, long length, char prefix) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char lenstr[128];
|
char lenstr[128];
|
||||||
size_t lenstr_len = snprintf(lenstr, sizeof(lenstr), "%c%ld\r\n", prefix, length);
|
lenstr[0] = prefix;
|
||||||
setDeferredReply(c, node, lenstr, lenstr_len);
|
size_t lenstr_len = ll2string(lenstr + 1, sizeof(lenstr) - 1, length);
|
||||||
|
lenstr[lenstr_len + 1] = '\r';
|
||||||
|
lenstr[lenstr_len + 2] = '\n';
|
||||||
|
setDeferredReply(c, node, lenstr, lenstr_len + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDeferredArrayLen(client *c, void *node, long length) {
|
void setDeferredArrayLen(client *c, void *node, long length) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user