mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-23 03:01:30 +00:00
Handle encoding errors for platform_vasprintf
This commit is contained in:
parent
e7d81937ae
commit
c33755b007
1 changed files with 3 additions and 0 deletions
3
ansi.c
3
ansi.c
|
@ -62,6 +62,9 @@ int platform_vasprintf(char **dat, const char *fmt, va_list args) {
|
|||
len = vsnprintf(buf, sizeof(buf), fmt, cpy);
|
||||
va_end (cpy);
|
||||
|
||||
if (len < 0)
|
||||
return len;
|
||||
|
||||
if (len < (int)sizeof(buf)) {
|
||||
*dat = util_strdup(buf);
|
||||
return len;
|
||||
|
|
Loading…
Reference in a new issue