mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 06:47:45 -04:00
fix corruption on empty sel_fname
This commit is contained in:
parent
7bf7acb6d6
commit
20b143089c
1 changed files with 6 additions and 6 deletions
12
menu.c
12
menu.c
|
@ -983,12 +983,12 @@ static const char *menu_loop_romsel(char *curr_path, int len,
|
||||||
|
|
||||||
// is this a dir or a full path?
|
// is this a dir or a full path?
|
||||||
if (!plat_is_dir(curr_path)) {
|
if (!plat_is_dir(curr_path)) {
|
||||||
char *p = curr_path + strlen(curr_path) - 1;
|
char *p = strrchr(curr_path, '/');
|
||||||
for (; p > curr_path && *p != '/'; p--)
|
if (p != NULL) {
|
||||||
;
|
*p = 0;
|
||||||
*p = 0;
|
curr_path_restore = p;
|
||||||
curr_path_restore = p;
|
snprintf(sel_fname, sizeof(sel_fname), "%s", p + 1);
|
||||||
snprintf(sel_fname, sizeof(sel_fname), "%s", p + 1);
|
}
|
||||||
|
|
||||||
if (rom_fname_reload[0] == 0)
|
if (rom_fname_reload[0] == 0)
|
||||||
show_help = 2;
|
show_help = 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue