mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
cleaned up code: various stuff (out-of-bounds, null-pointer, uninitialized vars,...) (by CleaningWoman)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6101 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -128,11 +128,10 @@ mainMenuEndElementHandle(void *userData, const XML_Char *name)
|
||||
else
|
||||
{
|
||||
strncpy(pData->curMainMenu.FileName,pData->szCharData,MAX_MAIN_MENU_CHARS);
|
||||
pData->curMainMenu.FileName[MAX_MAIN_MENU_CHARS] = '\0';
|
||||
pData->curMainMenu.FileName[MAX_MAIN_MENU_CHARS-1] = '\0';
|
||||
}
|
||||
|
||||
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_MAIN_MENU_CHARS);i++)
|
||||
{
|
||||
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_MAIN_MENU_CHARS);i++) {
|
||||
temp = pData->szCharData[i];
|
||||
pData->curMainMenu.FileName[i] = temp;
|
||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("itemEndElementHandle: szLocation[%d] = %s, temp = %s",i,&pData->curSectorLoadscreens.szLocation[i],&temp));
|
||||
|
||||
Reference in New Issue
Block a user