all: Check for return value of lseek

This commit is contained in:
Pali Rohár committed 2016-01-10 14:29:18 +01:00
1 parent 1ee86c05f4
commit b7f80de25d
5 files changed
+47 -9

No files matched your search

+2 -1
View File
@@ -92,7 +92,8 @@ int cal_init_file(const char * file, struct cal ** cal_out) {
blksize = lseek(fd, 0, SEEK_END);
if ( blksize == (off_t)-1 )
goto err;
lseek(fd, 0, SEEK_SET);
if ( lseek(fd, 0, SEEK_SET) == (off_t)-1 )
goto err;
#endif
if ( blksize > SSIZE_MAX )
goto err;