Skip to content

Commit

Permalink
fix writing before string when substring is not found (#17330)
Browse files Browse the repository at this point in the history
  • Loading branch information
warmenhoven authored Jan 2, 2025
1 parent 50c943a commit 9dd6e85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion menu/menu_displaylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,12 +866,15 @@ static int menu_displaylist_parse_core_info(
/* Show relevant note row and skip showing it later */
if (core_info->notes)
{
int spc;
unsigned j;
char firmware_basename[64];
fill_pathname_base(firmware_basename,
core_info->firmware[i].desc, sizeof(firmware_basename));

firmware_basename[string_find_index_substring_string(firmware_basename, " ")] = '\0';
spc = string_find_index_substring_string(firmware_basename, " ");
if (spc >= 0)
firmware_basename[spc] = '\0';

for (j = 0; j < core_info->note_list->size; j++)
{
Expand Down

0 comments on commit 9dd6e85

Please sign in to comment.