In select_file_handler properly initialize newpath preventing memory errors and crashes

This commit is contained in:
zicodxx 2010-08-27 20:32:05 +00:00
parent 887e8ed22c
commit 067d54f8e3
2 changed files with 3 additions and 1 deletions

View file

@ -4,6 +4,7 @@ D1X-Rebirth Changelog
--------
arch/include/jukebox.h, arch/sdl/jukebox.c, include/u_mem.h, main/menu.c: Add path browsing feature to make song file/directory selection easier
include/u_mem.h, main/menu.c: Moving upwards definition of MEM_K so it's not restricted to !NDEBUG; Initialized **i in list_dir_el properly to silence gcc when compiling
main/menu.c: In select_file_handler properly initialize newpath preventing memory errors and crashes
20100825
--------

View file

@ -1261,7 +1261,8 @@ int select_file_handler(listbox *menu, d_event *event, browser *b)
char **list = listbox_get_items(menu);
int citem = listbox_get_citem(menu);
const char *sep = PHYSFS_getDirSeparator();
memset(newpath, 0, sizeof(char)*PATH_MAX);
switch (event->type)
{
case EVENT_NEWMENU_SELECTED: