Fix bug in sdscatfmt when % is the last format char (#9173)

For the sdscatfmt function in sds.c, when the parameter fmt ended up with '%',
the behavior is undefined. This commit fix this bug.

Co-authored-by: stafuc <stafuc@gmail.com>
This commit is contained in:
Oran Agra 2021-07-01 08:19:04 +03:00 committed by GitHub
parent 16e04ed944
commit de9bae21ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -682,6 +682,7 @@ sds sdscatfmt(sds s, char const *fmt, ...) {
switch(*f) {
case '%':
next = *(f+1);
if (next == '\0') break;
f++;
switch(next) {
case 's':