aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-11-06 03:05:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-11-06 03:05:54 +0000
commit6bef3d1d2216234454875052220ca0f477a820b4 (patch)
tree717060345370b781d3d1cde7ab4dd29304a066e8 /util-linux
parent1bec1b980e3cf5ad604fb0c2038a3ab83d9ab5f5 (diff)
downloadbusybox-w32-6bef3d1d2216234454875052220ca0f477a820b4.tar.gz
busybox-w32-6bef3d1d2216234454875052220ca0f477a820b4.tar.bz2
busybox-w32-6bef3d1d2216234454875052220ca0f477a820b4.zip
fbset: fix buglet where we were using wrong pointer
readahead: stop using stdio.h *: style fixes
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)
27 27
28 len = (flags & 2) ? xatoul_range(size, 2, INT_MAX) : 16384; 28 len = (flags & 2) ? xatoul_range(size, 2, INT_MAX) : 16384;
29 buf = xmalloc(len); 29 buf = xmalloc(len);
30 if (0 > (len = klogctl(3 + (flags & 1), buf, len))) 30 len = klogctl(3 + (flags & 1), buf, len);
31 if (len < 0)
31 bb_perror_msg_and_die("klogctl"); 32 bb_perror_msg_and_die("klogctl");
32 33
33 // Skip <#> at the start of lines, and make sure we end with a newline. 34 // 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,
181 f = xfopen(fn, "r"); 181 f = xfopen(fn, "r");
182 while (!feof(f)) { 182 while (!feof(f)) {
183 fgets(buf, sizeof(buf), f); 183 fgets(buf, sizeof(buf), f);
184 if (!(p = strstr(buf, "mode ")) && !(p = strstr(buf, "mode\t"))) 184 p = strstr(buf, "mode ");
185 if (!p && !(p = strstr(buf, "mode\t")))
185 continue; 186 continue;
186 p += 5; 187 p = strstr(p + 5, mode);
187 if (!(p = strstr(buf, mode))) 188 if (!p)
188 continue; 189 continue;
189 p += strlen(mode); 190 p += strlen(mode);
190 if (!isspace(*p) && (*p != 0) && (*p != '"') 191 if (!isspace(*p) && (*p != 0) && (*p != '"')
@@ -193,7 +194,8 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
193 194
194 while (!feof(f)) { 195 while (!feof(f)) {
195 fgets(buf, sizeof(buf), f); 196 fgets(buf, sizeof(buf), f);
196 if ((p = strstr(buf, "geometry "))) { 197 p = strstr(buf, "geometry ");
198 if (p) {
197 p += 9; 199 p += 9;
198 /* FIXME: catastrophic on arches with 64bit ints */ 200 /* FIXME: catastrophic on arches with 64bit ints */
199 sscanf(p, "%d %d %d %d %d", 201 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)
1837 last_p_start_pos = 0; 1837 last_p_start_pos = 0;
1838 } 1838 }
1839 pe = &ptes[i]; 1839 pe = &ptes[i];
1840 if ((p = pe->part_table)->sys_ind) { 1840 p = pe->part_table;
1841 if (p->sys_ind) {
1841 p_start_pos = get_partition_start(pe); 1842 p_start_pos = get_partition_start(pe);
1842 1843
1843 if (last_p_start_pos > p_start_pos) { 1844 if (last_p_start_pos > p_start_pos) {