aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fbset.c
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/fbset.c
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/fbset.c')
-rw-r--r--util-linux/fbset.c10
1 files changed, 6 insertions, 4 deletions
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",