summaryrefslogtreecommitdiff
path: root/firmware/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/font.c')
-rw-r--r--firmware/font.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/firmware/font.c b/firmware/font.c
index e973108bca..cd74459b1e 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -613,11 +613,7 @@ void glyph_cache_save(struct font* pf)
613 pf = &font_ui; 613 pf = &font_ui;
614 if (pf->fd >= 0 && pf == &font_ui) 614 if (pf->fd >= 0 && pf == &font_ui)
615 { 615 {
616 char path[MAX_PATH]; 616 cache_fd = open(GLYPH_CACHE_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0666);
617 const char *file = get_user_file_path(GLYPH_CACHE_FILE, IS_FILE|NEED_WRITE,
618 path, sizeof(path));
619
620 cache_fd = open(file, O_WRONLY|O_CREAT|O_TRUNC, 0666);
621 if (cache_fd < 0) 617 if (cache_fd < 0)
622 return; 618 return;
623 619
@@ -678,7 +674,6 @@ static void glyph_cache_load(struct font* pf)
678 int i, size; 674 int i, size;
679 unsigned char tmp[2]; 675 unsigned char tmp[2];
680 unsigned short ch; 676 unsigned short ch;
681 char path[MAX_PATH];
682 unsigned short glyphs[MAX_SORT]; 677 unsigned short glyphs[MAX_SORT];
683 unsigned short glyphs_lru_order[MAX_SORT]; 678 unsigned short glyphs_lru_order[MAX_SORT];
684 int glyph_file_skip=0, glyph_file_size=0; 679 int glyph_file_skip=0, glyph_file_size=0;
@@ -687,8 +682,7 @@ static void glyph_cache_load(struct font* pf)
687 if ( sort_size > MAX_SORT ) 682 if ( sort_size > MAX_SORT )
688 sort_size = MAX_SORT; 683 sort_size = MAX_SORT;
689 684
690 fd = open(get_user_file_path(GLYPH_CACHE_FILE, IS_FILE|NEED_WRITE, 685 fd = open(GLYPH_CACHE_FILE, O_RDONLY|O_BINARY);
691 path, sizeof(path)), O_RDONLY|O_BINARY);
692 if (fd >= 0) { 686 if (fd >= 0) {
693 687
694 /* only read what fits */ 688 /* only read what fits */