Patch #250: Fix of mingw-w64 warnings concering out of boundary array access

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6484 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
f0rt 2014-05-18 19:32:50 +00:00
parent da5a85d147
commit 881fa61896
2 changed files with 12 additions and 12 deletions

View file

@ -247,7 +247,7 @@ EXTERN_C void NSISWinMainNOCRT()
CreateDirectory(state_temp_dir,NULL); CreateDirectory(state_temp_dir,NULL);
SetCurrentDirectory(state_temp_dir); SetCurrentDirectory(state_temp_dir);
if (!state_install_directory[0]) if (!(*state_install_directory))
mystrcpy(state_install_directory,state_exe_directory); mystrcpy(state_install_directory,state_exe_directory);
mystrcpy(g_usrvars[0], realcmds); mystrcpy(g_usrvars[0], realcmds);
@ -280,7 +280,7 @@ EXTERN_C void NSISWinMainNOCRT()
} }
} }
} }
g_usrvars[1][0]++; (*(((NSIS_STRING *)g_usrvars)[1]))++;
} }
#ifdef NSIS_SUPPORT_MOVEONREBOOT #ifdef NSIS_SUPPORT_MOVEONREBOOT

View file

@ -28,18 +28,18 @@ extern NSIS_STRING g_usrvarssection[1];
#define g_usrvars g_usrvarssection #define g_usrvars g_usrvarssection
#endif #endif
#define state_command_line g_usrvars[20] #define state_command_line (((NSIS_STRING *) g_usrvars)[20])
#define state_install_directory g_usrvars[21] #define state_install_directory (((NSIS_STRING *) g_usrvars)[21])
#define state_output_directory g_usrvars[22] #define state_output_directory (((NSIS_STRING *) g_usrvars)[22])
#define state_exe_directory g_usrvars[23] #define state_exe_directory (((NSIS_STRING *) g_usrvars)[23])
#define state_language g_usrvars[24] #define state_language (((NSIS_STRING *) g_usrvars)[24])
#define state_temp_dir g_usrvars[25] #define state_temp_dir (((NSIS_STRING *) g_usrvars)[25])
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT #ifdef NSIS_CONFIG_PLUGIN_SUPPORT
# define state_plugins_dir g_usrvars[26] # define state_plugins_dir (((NSIS_STRING *) g_usrvars)[26])
#endif #endif
#define state_exe_path g_usrvars[27] #define state_exe_path (((NSIS_STRING *) g_usrvars)[27])
#define state_exe_file g_usrvars[28] #define state_exe_file (((NSIS_STRING *) g_usrvars)[28])
#define state_click_next g_usrvars[30] #define state_click_next (((NSIS_STRING *) g_usrvars)[30])
extern TCHAR g_caption[NSIS_MAX_STRLEN*2]; extern TCHAR g_caption[NSIS_MAX_STRLEN*2];
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT #ifdef NSIS_CONFIG_VISIBLE_SUPPORT