In select_file_handler properly initialize newpath preventing memory errors and crashes
This commit is contained in:
parent
887e8ed22c
commit
067d54f8e3
|
@ -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
|
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
|
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
|
20100825
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -1261,7 +1261,8 @@ int select_file_handler(listbox *menu, d_event *event, browser *b)
|
||||||
char **list = listbox_get_items(menu);
|
char **list = listbox_get_items(menu);
|
||||||
int citem = listbox_get_citem(menu);
|
int citem = listbox_get_citem(menu);
|
||||||
const char *sep = PHYSFS_getDirSeparator();
|
const char *sep = PHYSFS_getDirSeparator();
|
||||||
|
|
||||||
|
memset(newpath, 0, sizeof(char)*PATH_MAX);
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case EVENT_NEWMENU_SELECTED:
|
case EVENT_NEWMENU_SELECTED:
|
||||||
|
|
Loading…
Reference in a new issue