summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorSami Kerola2016-07-04 23:09:10 +0200
committerSami Kerola2016-07-21 22:14:33 +0200
commit74ce680a3ef90503b26da0a34f04cf725f6c5beb (patch)
tree307baa695e1c36c7a7855718468d9913ddf96bc1 /text-utils
parentagetty: call uname() only when necessary (diff)
downloadkernel-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 'text-utils')
-rw-r--r--text-utils/hexdump-parse.c15
-rw-r--r--text-utils/tailf.c8
2 files changed, 9 insertions, 14 deletions
diff --git a/text-utils/hexdump-parse.c b/text-utils/hexdump-parse.c
index 9eb016d6a..c60a4d06b 100644
--- a/text-utils/hexdump-parse.c
+++ b/text-utils/hexdump-parse.c
@@ -460,15 +460,12 @@ isint: cs[3] = '\0';
fs->bcnt < hex->blocksize &&
!(fu->flags&F_SETREP) && fu->bcnt)
fu->reps += (hex->blocksize - fs->bcnt) / fu->bcnt;
- if (fu->reps > 1) {
- if (!list_empty(&fu->prlist)) {
- pr = list_last_entry(&fu->prlist,
- struct hexdump_pr, prlist);
- for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
- p2 = isspace(*p1) ? p1 : NULL;
- if (p2)
- pr->nospace = p2;
- }
+ if (fu->reps > 1 && !list_empty(&fu->prlist)) {
+ pr = list_last_entry(&fu->prlist, struct hexdump_pr, prlist);
+ for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
+ p2 = isspace(*p1) ? p1 : NULL;
+ if (p2)
+ pr->nospace = p2;
}
}
}
diff --git a/text-utils/tailf.c b/text-utils/tailf.c
index 34d0cd53b..c111d02c0 100644
--- a/text-utils/tailf.c
+++ b/text-utils/tailf.c
@@ -74,11 +74,9 @@ static void tailf(const char *filename, size_t lines, struct stat *st)
if (data[i] == '\n')
lines++;
while (i) {
- if (data[i] == '\n') {
- if (--lines == 0) {
- i++;
- break;
- }
+ if (data[i] == '\n' && --lines == 0) {
+ i++;
+ break;
}
i--;
}