diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-04-09 13:15:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-04-09 13:15:52 -0400 |
commit | 6132127cd75b1265e84daad00f3c1e5dfeef0e2c (patch) | |
tree | 4aaaf6e4f92634ce29cd5bcb5206d8df2fe6d613 /lib/fs.c | |
parent | bda58bb6886c1fa49a4ecfc5812f38921fb9e7f4 (diff) | |
download | spmc-6132127cd75b1265e84daad00f3c1e5dfeef0e2c.tar.gz |
Fail if seek fails
Diffstat (limited to 'lib/fs.c')
-rw-r--r-- | lib/fs.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -388,7 +388,9 @@ long int get_file_size(const char *filename) { if (!fp) { return -1; } - fseek(fp, 0, SEEK_END); + if (fseek(fp, 0, SEEK_END) < 0) { + return -1; + } result = ftell(fp); fclose(fp); return result; |