diff options
Diffstat (limited to 'firmware/font.c')
-rw-r--r-- | firmware/font.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/font.c b/firmware/font.c index e6f90e4ca5..a8d8786259 100644 --- a/firmware/font.c +++ b/firmware/font.c | |||
@@ -550,7 +550,14 @@ int font_load_ex(const char *path, size_t buffer_size) | |||
550 | } | 550 | } |
551 | int font_load(const char *path) | 551 | int font_load(const char *path) |
552 | { | 552 | { |
553 | return font_load_ex(path, MAX_FONT_SIZE); | 553 | int size; |
554 | int fd = open( path, O_RDONLY ); | ||
555 | if ( fd < 0 ) | ||
556 | return -1; | ||
557 | size = filesize(fd); | ||
558 | if (size > MAX_FONT_SIZE) | ||
559 | size = MAX_FONT_SIZE; | ||
560 | return font_load_ex(path, size); | ||
554 | } | 561 | } |
555 | 562 | ||
556 | void font_unload(int font_id) | 563 | void font_unload(int font_id) |