}
/* Skip over leading whitespace */
- word = *buf;
- while (isspace(*word)) {
- ++word;
- }
+ word = skip_whitespace(*buf);
/* Skip over comments */
if (*word == '#') {
{
int i;
+ if (!name)
+ return NULL;
+
for (i = 0; af[i]; i++) {
if (strcmp(af[i]->name, name) == 0) {
return af[i];
{
int i;
+ if (!name)
+ return NULL;
+
for (i = 0; i < af->n_methods; i++) {
if (strcmp(af->method[i].name, name) == 0) {
return &af->method[i];
static const llist_t *find_list_string(const llist_t *list, const char *string)
{
+ if (string == NULL)
+ return NULL;
+
while (list) {
if (strcmp(list->data, string) == 0) {
return list;
}
/* 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);