diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2013-01-14 19:30:10 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2013-01-14 19:30:10 +0100 |
commit | a6ec475a92ebfb9ab42685cb63b42a39656705ab (patch) | |
tree | e18051a5a7514511a72a52cb6dc57965c1b21d28 /src/fpid.c | |
parent | 783222ed007f93d16bfb224df3d10ddb47bf4a74 (diff) | |
parent | a6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (diff) | |
download | 0xFFFF-legacy.tar.bz2 |
Merge branch 'pvc' into legacylegacy
Diffstat (limited to 'src/fpid.c')
-rw-r--r-- | src/fpid.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -42,7 +42,12 @@ long fpid_size(const char *filename) { long sz; FILE *fd = fopen(filename, "r"); - fseek(fd, 0, SEEK_END); + if (fd == NULL) + return -1; + if (fseek(fd, 0, SEEK_END) != 0) { + fclose(fd); + return -1; + } sz = ftell(fd); fclose(fd); return sz; |