summaryrefslogtreecommitdiffstats
path: root/src/cal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cal.c')
-rw-r--r--src/cal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cal.c b/src/cal.c
index 99de241..102ffab 100644
--- a/src/cal.c
+++ b/src/cal.c
@@ -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;