mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-26 22:11:18 +00:00
Make Q_vsnprintf() more standard conform in bg_lib.c, patch by devhc
This commit is contained in:
parent
3b40467599
commit
476e35f50e
1 changed files with 2 additions and 9 deletions
|
@ -1740,13 +1740,8 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
|||
break; /* some picky compilers need this */
|
||||
}
|
||||
}
|
||||
if (buffer != NULL)
|
||||
{
|
||||
if (currlen < maxlen - 1)
|
||||
buffer[currlen] = '\0';
|
||||
else
|
||||
buffer[maxlen - 1] = '\0';
|
||||
}
|
||||
if (maxlen > 0)
|
||||
buffer[currlen] = '\0';
|
||||
return total;
|
||||
}
|
||||
|
||||
|
@ -2069,8 +2064,6 @@ static int dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
|
|||
|
||||
int Q_vsnprintf(char *str, size_t length, const char *fmt, va_list args)
|
||||
{
|
||||
if (str != NULL)
|
||||
str[0] = 0;
|
||||
return dopr(str, length, fmt, args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue