From bacbb0165bc4c3de5eb26e8ac67e86073c665875 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 2 May 2021 17:56:24 +0200 Subject: fiasco: Mute warning about uninitialized variables fs and checksum --- src/fiasco.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/fiasco.c b/src/fiasco.c index bae1ae3..c8b8af5 100644 --- a/src/fiasco.c +++ b/src/fiasco.c @@ -128,6 +128,7 @@ struct fiasco * fiasco_alloc_from_file(const char * file) { while ( 1 ) { /* If end of file, return fiasco image */ + checksum = 0x00; READ_OR_RETURN(fiasco, checksum, buf, 1); /* Header of next image (0x54) */ @@ -617,6 +618,8 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) { while ( image_list ) { + fd = -1; + image = image_list->image; printf("\n"); @@ -660,8 +663,10 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) { free(layout_name); - if ( ! simulate ) + if ( ! simulate ) { close(fd); + fd = -1; + } } @@ -713,8 +718,10 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) { free(name); - if ( ! simulate ) + if ( ! simulate ) { close(fd); + fd = -1; + } if ( image_part ) { image_part = image_part->next; -- cgit v1.2.3