From ff98a54cd954360be7e0770cfc987ce33447aa10 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Wed, 15 Feb 2023 01:27:50 -0500 Subject: 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 --- firmware/font.c | 16 ++++++++-------- 1 file 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) bool font_filename_matches_loaded_id(int font_id, char *filename) { - if ( font_id < 0 || font_id >= MAXFONTS ) - return NULL; - int handle = buflib_allocations[font_id]; - if (handle > 0) + if ( font_id >= 0 && font_id < MAXFONTS ) { - struct buflib_alloc_data *data = core_get_data(handle); - logf("%s id: [%d], %s", __func__, font_id, data->path); - return strcmp(data->path, filename) == 0; + int handle = buflib_allocations[font_id]; + if (handle > 0) + { + struct buflib_alloc_data *data = core_get_data(handle); + logf("%s id: [%d], %s", __func__, font_id, data->path); + return strcmp(data->path, filename) == 0; + } } - return false; } -- cgit v1.2.3