diff options
author | Denis Vlasenko | 2007-11-06 03:05:54 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-11-06 03:05:54 +0000 |
commit | 6bef3d1d2216234454875052220ca0f477a820b4 (patch) | |
tree | 717060345370b781d3d1cde7ab4dd29304a066e8 /util-linux/fbset.c | |
parent | 1bec1b980e3cf5ad604fb0c2038a3ab83d9ab5f5 (diff) | |
download | busybox-6bef3d1d2216234454875052220ca0f477a820b4.zip busybox-6bef3d1d2216234454875052220ca0f477a820b4.tar.gz |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index f67a283..d616abd 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", |