Make Q_vsnprintf() more standard conform in bg_lib.c, patch by devhc
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user