diff --git a/src/posix/cocoa/i_system.mm b/src/posix/cocoa/i_system.mm index 712e9b7e4..f3eddd689 100644 --- a/src/posix/cocoa/i_system.mm +++ b/src/posix/cocoa/i_system.mm @@ -182,7 +182,7 @@ void I_Error (const char *error, ...) va_start(argptr, error); - vsprintf (errortext, error, argptr); + myvsnprintf (errortext, MAX_ERRORTEXT, error, argptr); va_end (argptr); throw CRecoverableError(errortext); } diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index 16d3ee6d8..26f3519dd 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -243,7 +243,7 @@ void I_Error (const char *error, ...) va_start(argptr, error); - vsprintf (errortext, error, argptr); + myvsnprintf (errortext, MAX_ERRORTEXT, error, argptr); va_end (argptr); throw CRecoverableError(errortext); } diff --git a/src/sound/timidity/timidity.cpp b/src/sound/timidity/timidity.cpp index e657466c0..a21596ade 100644 --- a/src/sound/timidity/timidity.cpp +++ b/src/sound/timidity/timidity.cpp @@ -827,7 +827,7 @@ void cmsg(int type, int verbosity_level, const char *fmt, ...) char buf[1024]; va_list args; va_start(args, fmt); - vsprintf(buf, fmt, args); + myvsnprintf(buf, sizeof buf, fmt, args); va_end(args); I_DebugPrint(buf); #endif diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index 86ae9cec9..4618762f8 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -501,7 +501,7 @@ void Writef (HANDLE file, const char *format, ...) DWORD len; va_start (args, format); - len = vsprintf (buffer, format, args); + len = myvsnprintf (buffer, sizeof buffer, format, args); va_end (args); WriteFile (file, buffer, len, &len, NULL); }