@@ -210,14 +210,14 @@ static const char *getCurrentTickString(void)
210210 Empty the buffer passed in, then optionally prepend the current TickCount
211211 value in string form, depending on the setting of theDebugFlags.
212212*/
213- static void prepBuffer (char *buffer, int size )
213+ static void prepBuffer (char *buffer)
214214{
215215 buffer[0 ] = 0 ;
216216#ifdef ALLOW_DEBUG_UTILS
217217 if (theDebugFlags & DEBUG_FLAG_PREPEND_TIME)
218218 {
219219 strcpy (buffer, getCurrentTickString ());
220- strlcat (buffer, " " , size );
220+ strcat (buffer, " " );
221221 }
222222#endif
223223}
@@ -436,7 +436,7 @@ void DebugLog(const char *format, ...)
436436 if (theDebugFlags == 0 )
437437 MessageBoxWrapper (" DebugLog - Debug not inited properly" , " " , MB_OK|MB_TASKMODAL);
438438
439- prepBuffer (theBuffer, ARRAY_SIZE (theBuffer) );
439+ prepBuffer (theBuffer);
440440
441441 va_list args;
442442 va_start (args, format);
@@ -508,8 +508,8 @@ void DebugCrash(const char *format, ...)
508508 // make it big to avoid weird overflow bugs in debug mode
509509 char theCrashBuffer[ LARGE_BUFFER ];
510510
511- prepBuffer (theCrashBuffer, LARGE_BUFFER );
512- strlcat (theCrashBuffer, " ASSERTION FAILURE: " , LARGE_BUFFER );
511+ prepBuffer (theCrashBuffer);
512+ strlcat (theCrashBuffer, " ASSERTION FAILURE: " , ARRAY_SIZE (theCrashBuffer) );
513513
514514 va_list arg;
515515 va_start (arg, format);
@@ -538,7 +538,7 @@ void DebugCrash(const char *format, ...)
538538#endif
539539 }
540540
541- strlcat (theCrashBuffer, " \n\n Abort->exception; Retry->debugger; Ignore->continue" , LARGE_BUFFER );
541+ strlcat (theCrashBuffer, " \n\n Abort->exception; Retry->debugger; Ignore->continue" , ARRAY_SIZE (theCrashBuffer) );
542542
543543 const int result = doCrashBox (theCrashBuffer, useLogging);
544544
@@ -737,9 +737,9 @@ void ReleaseCrash(const char *reason)
737737 }
738738
739739 strcpy (prevbuf, TheGlobalData->getPath_UserData ().str ());
740- strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, _MAX_PATH );
740+ strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, ARRAY_SIZE (prevbuf) );
741741 strcpy (curbuf, TheGlobalData->getPath_UserData ().str ());
742- strlcat (curbuf, RELEASECRASH_FILE_NAME, _MAX_PATH );
742+ strlcat (curbuf, RELEASECRASH_FILE_NAME, ARRAY_SIZE (curbuf) );
743743
744744 remove (prevbuf);
745745 rename (curbuf, prevbuf);
@@ -826,9 +826,9 @@ void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m)
826826 char curbuf[ _MAX_PATH ];
827827
828828 strcpy (prevbuf, TheGlobalData->getPath_UserData ().str ());
829- strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, _MAX_PATH );
829+ strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, ARRAY_SIZE (prevbuf) );
830830 strcpy (curbuf, TheGlobalData->getPath_UserData ().str ());
831- strlcat (curbuf, RELEASECRASH_FILE_NAME, _MAX_PATH );
831+ strlcat (curbuf, RELEASECRASH_FILE_NAME, ARRAY_SIZE (curbuf) );
832832
833833 remove (prevbuf);
834834 rename (curbuf, prevbuf);
0 commit comments