Merge pull request #178 from rfuchs/master
va_copy must be followed by va_end
This commit is contained in:
commit
17d73ef6ad
1
sds.c
1
sds.c
@ -178,6 +178,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
|
|||||||
buf[buflen-2] = '\0';
|
buf[buflen-2] = '\0';
|
||||||
va_copy(cpy,ap);
|
va_copy(cpy,ap);
|
||||||
vsnprintf(buf, buflen, fmt, cpy);
|
vsnprintf(buf, buflen, fmt, cpy);
|
||||||
|
va_end(cpy);
|
||||||
if (buf[buflen-2] != '\0') {
|
if (buf[buflen-2] != '\0') {
|
||||||
free(buf);
|
free(buf);
|
||||||
buflen *= 2;
|
buflen *= 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user