replaced all usess of vsprintf by q_vsnprintf

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@320 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2010-08-31 16:57:12 +00:00
parent 49286c1eb2
commit 5ade0c29df
6 changed files with 16 additions and 17 deletions

View file

@ -1298,7 +1298,7 @@ char *va (const char *format, ...)
va_buf = get_va_buffer ();
va_start (argptr, format);
vsprintf (va_buf, format, argptr);
q_vsnprintf (va_buf, VA_BUFFERLEN, format, argptr);
va_end (argptr);
return va_buf;

View file

@ -497,7 +497,6 @@ Handles cursor positioning, line wrapping, etc
================
*/
#define MAXPRINTMSG 4096
// FIXME: make a buffer size safe vsprintf?
void Con_Printf (const char *fmt, ...)
{
va_list argptr;
@ -505,7 +504,7 @@ void Con_Printf (const char *fmt, ...)
static qboolean inupdate;
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr);
// also echo to debugging console
@ -549,7 +548,7 @@ void Con_Warning (const char *fmt, ...)
char msg[MAXPRINTMSG];
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr);
Con_SafePrintf ("\x02Warning: ");
@ -572,7 +571,7 @@ void Con_DPrintf (const char *fmt, ...)
return; // don't confuse non-developers with techie stuff...
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr);
Con_SafePrintf ("%s", msg); //johnfitz -- was Con_Printf
@ -593,7 +592,7 @@ void Con_DPrintf2 (const char *fmt, ...)
if (developer.value >= 2)
{
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr);
Con_Printf ("%s", msg);
@ -615,7 +614,7 @@ void Con_SafePrintf (const char *fmt, ...)
int temp;
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr);
temp = scr_disabled_for_loading;
@ -640,7 +639,7 @@ void Con_CenterPrintf (int linewidth, const char *fmt, ...)
int len, s;
va_start (argptr,fmt);
vsprintf (msg,fmt,argptr);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
va_end (argptr);
linewidth = min (linewidth, con_linewidth);

View file

@ -115,7 +115,7 @@ void Host_EndGame (const char *message, ...)
char string[1024];
va_start (argptr,message);
vsprintf (string,message,argptr);
q_vsnprintf (string, sizeof(string), message, argptr);
va_end (argptr);
Con_DPrintf ("Host_EndGame: %s\n",string);
@ -153,7 +153,7 @@ void Host_Error (const char *error, ...)
SCR_EndLoadingPlaque (); // reenable screen updates
va_start (argptr,error);
vsprintf (string,error,argptr);
q_vsnprintf (string, sizeof(string), error, argptr);
va_end (argptr);
Con_Printf ("Host_Error: %s\n",string);
@ -331,7 +331,7 @@ void SV_ClientPrintf (const char *fmt, ...)
char string[1024];
va_start (argptr,fmt);
vsprintf (string, fmt,argptr);
q_vsnprintf (string, sizeof(string), fmt,argptr);
va_end (argptr);
MSG_WriteByte (&host_client->message, svc_print);
@ -352,7 +352,7 @@ void SV_BroadcastPrintf (const char *fmt, ...)
int i;
va_start (argptr,fmt);
vsprintf (string, fmt,argptr);
q_vsnprintf (string, sizeof(string), fmt, argptr);
va_end (argptr);
for (i=0 ; i<svs.maxclients ; i++)
@ -376,7 +376,7 @@ void Host_ClientCommands (const char *fmt, ...)
char string[1024];
va_start (argptr,fmt);
vsprintf (string, fmt,argptr);
q_vsnprintf (string, sizeof(string), fmt, argptr);
va_end (argptr);
MSG_WriteByte (&host_client->message, svc_stufftext);

View file

@ -268,7 +268,7 @@ void PR_RunError (const char *error, ...)
char string[1024];
va_start (argptr,error);
vsprintf (string,error,argptr);
q_vsnprintf (string, sizeof(string), error, argptr);
va_end (argptr);
PR_PrintStatement (pr_statements + pr_xstatement);

View file

@ -163,7 +163,7 @@ void Sys_Error (const char *error, ...)
Host_Shutdown ();
va_start (argptr, error);
vsprintf (text, error, argptr);
q_vsnprintf (text, sizeof(text), error, argptr);
va_end (argptr);
fputs (errortxt2, stderr);

View file

@ -175,7 +175,7 @@ void Sys_Error (const char *error, ...)
DWORD dummy;
va_start (argptr, error);
vsprintf (text, error, argptr);
q_vsnprintf (text, sizeof(text), error, argptr);
va_end (argptr);
if (isDedicated)
@ -210,7 +210,7 @@ void Sys_Printf (const char *fmt, ...)
DWORD dummy;
va_start (argptr,fmt);
vsprintf (text, fmt, argptr);
q_vsnprintf (text, sizeof(text), fmt, argptr);
va_end (argptr);
if (isDedicated)