From 52dba73260d3934cbaf72deaef108d118cef4209 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 12 Jan 2014 16:07:49 -0600 Subject: Fix demoName Com_sprintf size larger than buffer Maybe this is why demoName is a static global with the comment 'compiler bug workaround'? --- src/client/cl_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client') 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)) -- cgit