forked from len0rd/rockbox
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
This commit is contained in:
parent
91c8633e8c
commit
ff98a54cd9
1 changed files with 8 additions and 8 deletions
|
|
@ -353,8 +353,8 @@ static int find_font_index(const char* path)
|
||||||
|
|
||||||
bool font_filename_matches_loaded_id(int font_id, char *filename)
|
bool font_filename_matches_loaded_id(int font_id, char *filename)
|
||||||
{
|
{
|
||||||
if ( font_id < 0 || font_id >= MAXFONTS )
|
if ( font_id >= 0 && font_id < MAXFONTS )
|
||||||
return NULL;
|
{
|
||||||
int handle = buflib_allocations[font_id];
|
int handle = buflib_allocations[font_id];
|
||||||
if (handle > 0)
|
if (handle > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -362,7 +362,7 @@ bool font_filename_matches_loaded_id(int font_id, char *filename)
|
||||||
logf("%s id: [%d], %s", __func__, font_id, data->path);
|
logf("%s id: [%d], %s", __func__, font_id, data->path);
|
||||||
return strcmp(data->path, filename) == 0;
|
return strcmp(data->path, filename) == 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue