summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2023-02-15 01:27:50 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2023-02-15 01:27:50 -0500
commitff98a54cd954360be7e0770cfc987ce33447aa10 (patch)
treeb860688d6a751d22ac9cdc8413fdb75b850a863c
parent91c8633e8ca7757731d6f5a10ff7c85738333cba (diff)
downloadrockbox-ff98a54cd954360be7e0770cfc987ce33447aa10.tar.gz
rockbox-ff98a54cd954360be7e0770cfc987ce33447aa10.zip
font.c return false if id is out of range instead of NULL
forgot to change this to match the bool return Change-Id: I2cc6dc985b07f2bc0ae493b060aff6105f329097
-rw-r--r--firmware/font.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 8c268bea5f..97fee16dc2 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -353,16 +353,16 @@ static int find_font_index(const char* path)
353 353
354bool font_filename_matches_loaded_id(int font_id, char *filename) 354bool font_filename_matches_loaded_id(int font_id, char *filename)
355{ 355{
356 if ( font_id < 0 || font_id >= MAXFONTS ) 356 if ( font_id >= 0 && font_id < MAXFONTS )
357 return NULL;
358 int handle = buflib_allocations[font_id];
359 if (handle > 0)
360 { 357 {
361 struct buflib_alloc_data *data = core_get_data(handle); 358 int handle = buflib_allocations[font_id];
362 logf("%s id: [%d], %s", __func__, font_id, data->path); 359 if (handle > 0)
363 return strcmp(data->path, filename) == 0; 360 {
361 struct buflib_alloc_data *data = core_get_data(handle);
362 logf("%s id: [%d], %s", __func__, font_id, data->path);
363 return strcmp(data->path, filename) == 0;
364 }
364 } 365 }
365
366 return false; 366 return false;
367} 367}
368 368