Make Q_vsnprintf() more standard conform in bg_lib.c, patch by devhc

This commit is contained in:
Thilo Schulz 2011-02-09 01:31:26 +00:00
parent 3b40467599
commit 476e35f50e
1 changed files with 2 additions and 9 deletions

View File

@ -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);
}