1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Frank Dischner 2006-04-24 16:02:44 +00:00
parent 38ae72ac1e
commit bf64c45148
2 changed files with 5 additions and 7 deletions

View file

@ -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]);