Audit bb_common_bufsiz usage, add script which looks for misuse.

tr: stop using globals needlessly.
code: -103 bytes
This commit is contained in:
Denis Vlasenko
2007-06-04 10:16:52 +00:00
parent 4e5f82c76f
commit 74324c8666
21 changed files with 141 additions and 135 deletions

View File

@ -29,12 +29,13 @@ static void do_sethostname(char *s, int isfile)
}
} else {
f = xfopen(s, "r");
while (fgets(bb_common_bufsiz1, sizeof(bb_common_bufsiz1), f) != NULL) {
if (bb_common_bufsiz1[0] == '#') {
#define strbuf bb_common_bufsiz1
while (fgets(strbuf, sizeof(strbuf), f) != NULL) {
if (strbuf[0] == '#') {
continue;
}
chomp(bb_common_bufsiz1);
do_sethostname(bb_common_bufsiz1, 0);
chomp(strbuf);
do_sethostname(strbuf, 0);
}
if (ENABLE_FEATURE_CLEAN_UP)
fclose(f);