diff options
author | Zack Middleton <zturtleman@gmail.com> | 2014-01-12 16:07:49 -0600 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2014-06-17 17:43:38 +0100 |
commit | 52dba73260d3934cbaf72deaef108d118cef4209 (patch) | |
tree | a9fb43aaf2f3c3c4444439fa71e0a5a10e9fb228 /src/client | |
parent | cedbcd824a1642f7f6e9a913ae2c21ca38aabc03 (diff) |
Fix demoName Com_sprintf size larger than buffer
Maybe this is why demoName is a static global with the comment 'compiler bug workaround'?
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/cl_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 6d4d132c..0bfc16c9 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -667,7 +667,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) @@ -681,7 +681,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 ); } @@ -736,7 +736,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 ) ); Com_sprintf (name, sizeof(name), "demos/%s.%s%d", demoName, DEMOEXT, PROTOCOL_VERSION ); if (!FS_FileExists(name)) |