Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bug fix multiboot.c get_redirect_dir didn't reach index 0

add_path[0] was never reached

Change-Id: If375a70832b0666d87f7d87b136cc377484b9ec1

+3 -3
+3 -3
firmware/common/multiboot.c
··· 41 41 int payload_len = EKEY_NOT_FOUND; 42 42 43 43 /* search for boot data header prior to search_len */ 44 - for(int i = 0;i < search_len;i++) 44 + for(int i = 0; i < search_len; i++) 45 45 { 46 46 fw_boot_data = (struct boot_data_t*) &buf[i]; 47 47 if (fw_boot_data->magic[0] != BOOT_DATA_MAGIC0 || ··· 83 83 const char* rootdir, const char* firmware) 84 84 { 85 85 int fd; 86 - int f_offset; 86 + size_t f_offset; 87 87 char add_path[MAX_PATH]; 88 88 /* Check in root of volume for rockbox_main.<playername> redirect */ 89 89 snprintf(add_path, sizeof(add_path), "/<%d>/"BOOT_REDIR, volume); ··· 96 96 f_offset = read(fd, add_path,sizeof(add_path)); 97 97 close(fd); 98 98 99 - for(int i = f_offset - 1;i > 0; i--) 99 + for(size_t i = f_offset - 1; i < f_offset; i--) 100 100 { 101 101 /* strip control chars < SPACE or all if path doesn't start with '/' */ 102 102 if (add_path[i] < 0x20 || add_path[0] != '/')