mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-18 02:24:54 +00:00
Pass the correct va_list to vsnprintf().
This commit is contained in:
parent
5da37869f2
commit
e99877752f
1 changed files with 4 additions and 4 deletions
|
@ -302,7 +302,7 @@ string_printf(string *str, const char_t *fmt, ...)
|
|||
ssize_t
|
||||
string_vprintf(string *str, const char_t *fmt, va_list ap)
|
||||
{
|
||||
va_list ap2;
|
||||
va_list apc;
|
||||
ssize_t res, ret;
|
||||
int len;
|
||||
|
||||
|
@ -312,9 +312,9 @@ string_vprintf(string *str, const char_t *fmt, va_list ap)
|
|||
*/
|
||||
for (;;) {
|
||||
res = str->size / sizeof(char_t) - str->len;
|
||||
va_copy(ap2, ap);
|
||||
len = vsnprintf(str->buf + str->len, res, fmt, ap);
|
||||
va_end(ap2);
|
||||
va_copy(apc, ap);
|
||||
len = vsnprintf(str->buf + str->len, res, fmt, apc);
|
||||
va_end(apc);
|
||||
if (len < res)
|
||||
break;
|
||||
str->buf[str->len] = 0;
|
||||
|
|
Loading…
Reference in a new issue