Fix regression in u8_vprintf()

My fault
This commit is contained in:
Lassi Kortela 2019-08-10 01:05:41 +03:00
parent be3c93e2b8
commit 0e75fcb197
1 changed files with 2 additions and 1 deletions

View File

@ -633,8 +633,9 @@ size_t u8_vprintf(const char *fmt, va_list ap)
return 0;
}
if (!(buf = calloc(cnt + 1, 1))) {
vsnprintf(buf, cnt + 1, fmt, ap);
return 0;
}
vsnprintf(buf, cnt + 1, fmt, ap);
if (!(wcs = calloc(cnt + 1, sizeof(uint32_t)))) {
free(buf);
return 0;