diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 10:16:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-04 10:16:52 +0000 |
commit | 74324c86663f57a19c1de303ee8c8e5449db9ef2 (patch) | |
tree | 11f5da9de4212875ce5811be2e1050e076378c9a /networking/hostname.c | |
parent | 4e5f82c76f08614d0b69f9ec4a8baac303af15f6 (diff) | |
download | busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.gz busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.bz2 busybox-w32-74324c86663f57a19c1de303ee8c8e5449db9ef2.zip |
Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
Diffstat (limited to 'networking/hostname.c')
-rw-r--r-- | networking/hostname.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/hostname.c b/networking/hostname.c index 50ef7b5d1..862bbdfa2 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -29,12 +29,13 @@ static void do_sethostname(char *s, int isfile) | |||
29 | } | 29 | } |
30 | } else { | 30 | } else { |
31 | f = xfopen(s, "r"); | 31 | f = xfopen(s, "r"); |
32 | while (fgets(bb_common_bufsiz1, sizeof(bb_common_bufsiz1), f) != NULL) { | 32 | #define strbuf bb_common_bufsiz1 |
33 | if (bb_common_bufsiz1[0] == '#') { | 33 | while (fgets(strbuf, sizeof(strbuf), f) != NULL) { |
34 | if (strbuf[0] == '#') { | ||
34 | continue; | 35 | continue; |
35 | } | 36 | } |
36 | chomp(bb_common_bufsiz1); | 37 | chomp(strbuf); |
37 | do_sethostname(bb_common_bufsiz1, 0); | 38 | do_sethostname(strbuf, 0); |
38 | } | 39 | } |
39 | if (ENABLE_FEATURE_CLEAN_UP) | 40 | if (ENABLE_FEATURE_CLEAN_UP) |
40 | fclose(f); | 41 | fclose(f); |