summaryrefslogtreecommitdiff
path: root/write.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-05-25 09:50:45 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-05-25 09:53:54 +1000
commit49524b5db4867b5e896ed299fd66b390e68f1ffc (patch)
tree1c9392debd75e73b092f2df5c4827388fc141b26 /write.c
parent33f944705c6c42e1b52f6ec62131d31f737c638f (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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/write.c b/write.c
index e68b70c..d86ce5f 100644
--- a/write.c
+++ b/write.c
@@ -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");