summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2021-05-02 17:56:24 +0200
committerPali Rohár <pali.rohar@gmail.com>2021-05-02 17:56:24 +0200
commitbacbb0165bc4c3de5eb26e8ac67e86073c665875 (patch)
treec2d7491c35278ae2b82b83ab56a1b3dc18dbdb0f
parentdf2340e48d0a79d06e77bb8913c35c8dd39fdc52 (diff)
download0xFFFF-bacbb0165bc4c3de5eb26e8ac67e86073c665875.tar.bz2
fiasco: Mute warning about uninitialized variables fs and checksum
-rw-r--r--src/fiasco.c11
1 files 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;