From 32c7fa82a21da2e04f0310b684afe2fabf38215c Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 9 Jun 2016 18:18:14 +1000 Subject: [PATCH] Tidy --- lrzip.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lrzip.c b/lrzip.c index 43144b5..ffdb85d 100644 --- a/lrzip.c +++ b/lrzip.c @@ -788,9 +788,10 @@ bool decompress_file(rzip_control *control) if (unlikely(!open_tmpoutbuf(control))) return false; - if (!STDIN) + if (!STDIN) { if (unlikely(!read_magic(control, fd_in, &expected_size))) return false; + } if (!STDOUT && !TEST_ONLY) { /* Check if there's enough free space on the device chosen to fit the @@ -960,7 +961,8 @@ bool get_fileinfo(rzip_control *control) infile_size = st.st_size; /* Get decompressed size */ - if (unlikely(!read_magic(control, fd_in, &expected_size))) goto error; + if (unlikely(!read_magic(control, fd_in, &expected_size))) + goto error; if (ENCRYPT) { print_output("Encrypted lrzip archive. No further information available\n"); @@ -1220,10 +1222,14 @@ bool compress_file(rzip_control *control) fatal_goto(("Failed to create %s\n", control->outfile), error); } control->fd_out = fd_out; - if (!STDIN) - if (unlikely(!preserve_perms(control, fd_in, fd_out))) goto error; - } else - if (unlikely(!open_tmpoutbuf(control))) goto error; + if (!STDIN) { + if (unlikely(!preserve_perms(control, fd_in, fd_out))) + goto error; + } + } else { + if (unlikely(!open_tmpoutbuf(control))) + goto error; + } /* Write zeroes to header at beginning of file */ if (unlikely(!STDOUT && write(fd_out, header, sizeof(header)) != sizeof(header))) @@ -1232,8 +1238,10 @@ bool compress_file(rzip_control *control) rzip_fd(control, fd_in, fd_out); /* Wwrite magic at end b/c lzma does not tell us properties until it is done */ - if (!STDOUT) - if (unlikely(!write_magic(control))) goto error; + if (!STDOUT) { + if (unlikely(!write_magic(control))) + goto error; + } if (ENCRYPT) release_hashes(control);