mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-19 02:54:55 +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
|
ssize_t
|
||||||
string_vprintf(string *str, const char_t *fmt, va_list ap)
|
string_vprintf(string *str, const char_t *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
va_list ap2;
|
va_list apc;
|
||||||
ssize_t res, ret;
|
ssize_t res, ret;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
@ -312,9 +312,9 @@ string_vprintf(string *str, const char_t *fmt, va_list ap)
|
||||||
*/
|
*/
|
||||||
for (;;) {
|
for (;;) {
|
||||||
res = str->size / sizeof(char_t) - str->len;
|
res = str->size / sizeof(char_t) - str->len;
|
||||||
va_copy(ap2, ap);
|
va_copy(apc, ap);
|
||||||
len = vsnprintf(str->buf + str->len, res, fmt, ap);
|
len = vsnprintf(str->buf + str->len, res, fmt, apc);
|
||||||
va_end(ap2);
|
va_end(apc);
|
||||||
if (len < res)
|
if (len < res)
|
||||||
break;
|
break;
|
||||||
str->buf[str->len] = 0;
|
str->buf[str->len] = 0;
|
||||||
|
|
Loading…
Reference in a new issue