use skip_whitespace where appropriate

This commit is contained in:
Denis Vlasenko
2006-10-25 12:46:03 +00:00
parent c8400a2162
commit d18a3a20db
8 changed files with 98 additions and 105 deletions

View File

@@ -572,10 +572,7 @@ static char *next_word(char **buf)
}
/* Skip over leading whitespace */
word = *buf;
while (isspace(*word)) {
++word;
}
word = skip_whitespace(*buf);
/* Skip over comments */
if (*word == '#') {
@@ -712,9 +709,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
}
/* ship any trailing whitespace */
while (isspace(*buf_ptr)) {
++buf_ptr;
}
buf_ptr = skip_whitespace(buf_ptr);
if (buf_ptr[0] != '\0') {
bb_error_msg("too many parameters \"%s\"", buf);

View File

@@ -302,7 +302,7 @@ int wget_main(int argc, char **argv)
s = buf;
while (*s != '\0' && !isspace(*s)) ++s;
while (isspace(*s)) ++s;
s = skip_whitespace(s);
// FIXME: no error check
// xatou wouldn't work: "200 OK"
status = atoi(s);