diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2020-04-09 13:46:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 13:46:36 -0400 |
commit | 0f0dd17bc5a2c3149684f2a50fbefae09e49be72 (patch) | |
tree | c7c207c995fcc69d9f0b0d338120676853ec3a49 /lib/fs.c | |
parent | bda58bb6886c1fa49a4ecfc5812f38921fb9e7f4 (diff) | |
parent | 5fab65a9f8c026ccd9e4c58cbe1d2aea06c28305 (diff) | |
download | spmc-0f0dd17bc5a2c3149684f2a50fbefae09e49be72.tar.gz |
Merge pull request #17 from jhunkeler/test-get_file_size
Test get file size
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; |