-
-/*
- * brkstring.c -- (destructively) split a string into
+/* brkstring.c -- (destructively) split a string into
* -- an array of substrings
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
if (!c || brkany (c, brkterm)) {
*s = '\0';
broken[i] = NULL;
- return broken;
+ break;
}
/* set next start addr */
; /* empty body */
}
- return broken; /* NOT REACHED */
+ return broken;
}
static int
brkany (char c, char *str)
{
- char *s;
-
- if (str) {
- for (s = str; *s; s++)
- if (c == *s)
- return 1;
- }
- return 0;
+ return str && c && strchr(str, c);
}