diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-05-25 09:50:45 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-05-25 09:53:54 +1000 |
commit | 49524b5db4867b5e896ed299fd66b390e68f1ffc (patch) | |
tree | 1c9392debd75e73b092f2df5c4827388fc141b26 /write.c | |
parent | 33f944705c6c42e1b52f6ec62131d31f737c638f (diff) |
Fail if ftell fails
Fixes a coverity warning: ftell may return -1 on error which we then pass into
fseek later. We properly fail there anyway, so this change is unlikely to have
any real effect.
Diffstat (limited to 'write.c')
-rw-r--r-- | write.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -758,6 +758,10 @@ writeEBLC(FILE* out, FontPtr font) int offset; location = ftell(out); + if (location == -1) { + perror("Couldn't ftell"); + return -1; + } rc = fseek(out, table->location + 4, SEEK_SET); if(rc != 0) { perror("Couldn't seek"); |