Fix SDS misuse in enumConfigSet(). Related to #6778.
This commit is contained in:
parent
adaa89c8a4
commit
e45e07a268
@ -1666,12 +1666,12 @@ static int enumConfigSet(typeData data, sds value, int update, char **err) {
|
|||||||
sds enumerr = sdsnew("argument must be one of the following: ");
|
sds enumerr = sdsnew("argument must be one of the following: ");
|
||||||
configEnum *enumNode = data.enumd.enum_value;
|
configEnum *enumNode = data.enumd.enum_value;
|
||||||
while(enumNode->name != NULL) {
|
while(enumNode->name != NULL) {
|
||||||
enumerr = sdscatlen(enumerr, enumNode->name, strlen(enumNode->name));
|
enumerr = sdscatlen(enumerr, enumNode->name,
|
||||||
|
strlen(enumNode->name));
|
||||||
enumerr = sdscatlen(enumerr, ", ", 2);
|
enumerr = sdscatlen(enumerr, ", ", 2);
|
||||||
enumNode++;
|
enumNode++;
|
||||||
}
|
}
|
||||||
|
sdsrange(enumerr,0,-3); /* Remove final ", ". */
|
||||||
enumerr[sdslen(enumerr) - 2] = '\0';
|
|
||||||
|
|
||||||
strncpy(loadbuf, enumerr, LOADBUF_SIZE);
|
strncpy(loadbuf, enumerr, LOADBUF_SIZE);
|
||||||
loadbuf[LOADBUF_SIZE - 1] = '\0';
|
loadbuf[LOADBUF_SIZE - 1] = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user