summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b224e5c..a6994b8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -212,7 +212,10 @@ static void parse_image_arg(char * arg, struct image_list ** image_first) {
ERROR_INFO("Cannot get size of file %s", layout_file);
exit(1);
}
- lseek(fd, 0, SEEK_SET);
+ if ( lseek(fd, 0, SEEK_SET) == (off_t)-1 ) {
+ ERROR_INFO("Cannot seek to begin of file %s", layout_file);
+ exit(1);
+ }
layout = malloc(len+1);
if ( ! layout ) {
ALLOC_ERROR();