From bc3fa5393762549a16f9de3e238a986607015fe3 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 5 Mar 2022 09:33:45 -0500 Subject: Sansa Multiboot Root Redirect Enhance + bug fix filename buffer was too small to retrieve redirect path if redirected to sd root remove as it is redundant Change-Id: I1326601f1ba4a18d6bc173798759eb762b55528c --- apps/debug_menu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 1b341a96e4..6b76aac162 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -2526,20 +2526,21 @@ static bool dbg_skin_engine(void) #if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) static bool dbg_boot_data(void) { - unsigned int crc = 0; + unsigned int crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); struct simplelist_info info; info.scroll_all = true; simplelist_info_init(&info, "Boot data", 1, NULL); simplelist_set_line_count(0); - crc = crc_32(boot_data.payload, boot_data.length, 0xffffffff); + #if defined(HAVE_MULTIBOOT) - char rootpath[VOL_MAX_LEN+2] = RB_ROOT_CONTENTS_DIR; + char rootpath[MAX_PATH / 2] = RB_ROOT_CONTENTS_DIR; int boot_volume = 0; if(crc == boot_data.crc) { boot_volume = boot_data.boot_volume; /* boot volume contained in uint8_t payload */ - get_redirect_dir(rootpath, sizeof(rootpath), boot_volume, "", ""); - rootpath[path_strip_trailing_separators(rootpath,NULL)] = '\0'; + int rtlen = get_redirect_dir(rootpath, sizeof(rootpath), boot_volume, "", ""); + while (rtlen > 0 && rootpath[--rtlen] == PATH_SEPCH) /* remove extra separators */ + rootpath[rtlen] = '\0'; } simplelist_addline("Boot Volume: <%lu>", boot_volume); simplelist_addline("Root:"); -- cgit v1.2.3