- Replace vsprintf function in bg_lib.c with vsnprintf implementation started by Patrick Powell.

- Remove all calls to vsprintf in the engine and gamecode and replace them with calls to vsnprintf.
This commit is contained in:
Thilo Schulz 2008-03-25 21:36:09 +00:00
parent 5728fc2ec8
commit bb47026b5f
19 changed files with 813 additions and 309 deletions

View file

@ -241,7 +241,7 @@ void QDECL G_Printf( const char *fmt, ... ) {
char text[1024];
va_start (argptr, fmt);
vsprintf (text, fmt, argptr);
Q_vsnprintf (text, sizeof(text), fmt, argptr);
va_end (argptr);
trap_Printf( text );
@ -252,7 +252,7 @@ void QDECL G_Error( const char *fmt, ... ) {
char text[1024];
va_start (argptr, fmt);
vsprintf (text, fmt, argptr);
Q_vsnprintf (text, sizeof(text), fmt, argptr);
va_end (argptr);
trap_Error( text );
@ -539,7 +539,7 @@ void QDECL Com_Error ( int level, const char *error, ... ) {
char text[1024];
va_start (argptr, error);
vsprintf (text, error, argptr);
Q_vsnprintf (text, sizeof(text), error, argptr);
va_end (argptr);
G_Error( "%s", text);
@ -550,7 +550,7 @@ void QDECL Com_Printf( const char *msg, ... ) {
char text[1024];
va_start (argptr, msg);
vsprintf (text, msg, argptr);
Q_vsnprintf (text, sizeof(text), msg, argptr);
va_end (argptr);
G_Printf ("%s", text);
@ -1092,7 +1092,7 @@ void QDECL G_LogPrintf( const char *fmt, ... ) {
Com_sprintf( string, sizeof(string), "%3i:%i%i ", min, tens, sec );
va_start( argptr, fmt );
vsprintf( string +7 , fmt,argptr );
Q_vsnprintf(string + 7, sizeof(string - 7), fmt, argptr);
va_end( argptr );
if ( g_dedicated.integer ) {