aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/dmesg.c3
-rw-r--r--util-linux/fbset.c10
-rw-r--r--util-linux/fdisk.c3
3 files changed, 10 insertions, 6 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 1adb0fc2f..90b327b4c 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -27,7 +27,8 @@ int dmesg_main(int argc, char **argv)
len = (flags & 2) ? xatoul_range(size, 2, INT_MAX) : 16384;
buf = xmalloc(len);
- if (0 > (len = klogctl(3 + (flags & 1), buf, len)))
+ len = klogctl(3 + (flags & 1), buf, len);
+ if (len < 0)
bb_perror_msg_and_die("klogctl");
// Skip <#> at the start of lines, and make sure we end with a newline.
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index f67a283c1..d616abd36 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -181,10 +181,11 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
f = xfopen(fn, "r");
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
- if (!(p = strstr(buf, "mode ")) && !(p = strstr(buf, "mode\t")))
+ p = strstr(buf, "mode ");
+ if (!p && !(p = strstr(buf, "mode\t")))
continue;
- p += 5;
- if (!(p = strstr(buf, mode)))
+ p = strstr(p + 5, mode);
+ if (!p)
continue;
p += strlen(mode);
if (!isspace(*p) && (*p != 0) && (*p != '"')
@@ -193,7 +194,8 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
- if ((p = strstr(buf, "geometry "))) {
+ p = strstr(buf, "geometry ");
+ if (p) {
p += 9;
/* FIXME: catastrophic on arches with 64bit ints */
sscanf(p, "%d %d %d %d %d",
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 01c01bd24..3b60847c9 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -1837,7 +1837,8 @@ wrong_p_order(int *prev)
last_p_start_pos = 0;
}
pe = &ptes[i];
- if ((p = pe->part_table)->sys_ind) {
+ p = pe->part_table;
+ if (p->sys_ind) {
p_start_pos = get_partition_start(pe);
if (last_p_start_pos > p_start_pos) {