diff options
author | Sami Kerola | 2016-07-04 23:09:10 +0200 |
---|---|---|
committer | Sami Kerola | 2016-07-21 22:14:33 +0200 |
commit | 74ce680a3ef90503b26da0a34f04cf725f6c5beb (patch) | |
tree | 307baa695e1c36c7a7855718468d9913ddf96bc1 /disk-utils/fsck.cramfs.c | |
parent | agetty: call uname() only when necessary (diff) | |
download | kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.gz kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.xz kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.zip |
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'disk-utils/fsck.cramfs.c')
-rw-r--r-- | disk-utils/fsck.cramfs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index ef311c103..d904037d3 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -403,10 +403,8 @@ static void do_uncompress(char *path, int outfd, unsigned long offset, size); } size -= out; - if (*extract_dir != '\0') - if (write(outfd, outbuffer, out) < 0) - err(FSCK_EX_ERROR, _("write failed: %s"), - path); + if (*extract_dir != '\0' && write(outfd, outbuffer, out) < 0) + err(FSCK_EX_ERROR, _("write failed: %s"), path); curr = next; } while (size); } @@ -629,9 +627,8 @@ static void test_fs(int start) _("directory data end (%lu) != file data start (%lu)"), end_dir, start_data); } - if (super.flags & CRAMFS_FLAG_FSID_VERSION_2) - if (end_data > super.size) - errx(FSCK_EX_UNCORRECTED, _("invalid file data offset")); + if (super.flags & CRAMFS_FLAG_FSID_VERSION_2 && end_data > super.size) + errx(FSCK_EX_UNCORRECTED, _("invalid file data offset")); iput(root); /* free(root) */ } |