From bf64c451488a0e73ceda1fe45d4e9d0230ef1201 Mon Sep 17 00:00:00 2001 From: Frank Dischner Date: Mon, 24 Apr 2006 16:02:44 +0000 Subject: Use filesize instead of lseek to find the size of a file. Reduces disk access and improves font loading time. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9792 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/unicode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'firmware/common/unicode.c') diff --git a/firmware/common/unicode.c b/firmware/common/unicode.c index 75165e4..8378039 100644 --- a/firmware/common/unicode.c +++ b/firmware/common/unicode.c @@ -62,8 +62,7 @@ int load_cp_table(int cp) return 0; } - tablesize = lseek(file, 0, SEEK_END) / 2; - lseek(file, 0, SEEK_SET); + tablesize = filesize(file) / 2; if (tablesize > MAX_CP_TABLE_SIZE) { DEBUGF("Invalid codepage file: %s.cp\n", filename[table-1]); -- cgit v1.1