mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 22:42:09 +00:00
Fix demoName Com_sprintf size larger than buffer
Maybe this is why demoName is a static global with the comment 'compiler bug workaround'?
This commit is contained in:
parent
43c6ebee8d
commit
52e72408d9
1 changed files with 3 additions and 3 deletions
|
@ -670,7 +670,7 @@ void CL_StopRecord_f( void ) {
|
|||
CL_DemoFilename
|
||||
==================
|
||||
*/
|
||||
void CL_DemoFilename( int number, char *fileName ) {
|
||||
void CL_DemoFilename( int number, char *fileName, int fileNameSize ) {
|
||||
int a,b,c,d;
|
||||
|
||||
if(number < 0 || number > 9999)
|
||||
|
@ -684,7 +684,7 @@ void CL_DemoFilename( int number, char *fileName ) {
|
|||
number -= c*10;
|
||||
d = number;
|
||||
|
||||
Com_sprintf( fileName, MAX_OSPATH, "demo%i%i%i%i"
|
||||
Com_sprintf( fileName, fileNameSize, "demo%i%i%i%i"
|
||||
, a, b, c, d );
|
||||
}
|
||||
|
||||
|
@ -744,7 +744,7 @@ void CL_Record_f( void ) {
|
|||
|
||||
// scan for a free demo name
|
||||
for ( number = 0 ; number <= 9999 ; number++ ) {
|
||||
CL_DemoFilename( number, demoName );
|
||||
CL_DemoFilename( number, demoName, sizeof( demoName ) );
|
||||
#ifdef LEGACY_PROTOCOL
|
||||
if(clc.compat)
|
||||
Com_sprintf(name, sizeof(name), "demos/%s.%s%d", demoName, DEMOEXT, com_legacyprotocol->integer);
|
||||
|
|
Loading…
Reference in a new issue