}
/* handle separators */
- while ((c=*s) && strchr(brksep, c)) {
+ while ((c=*s) && brksep && strchr(brksep, c)) {
*s++ = '\0';
}
** we are either at the end of the string, or the
** terminator found has been found, so finish up.
*/
- if (!c || strchr(brkterm, c)) {
+ if (!c || (brkterm && strchr(brkterm, c))) {
*s = '\0';
broken[i] = NULL;
return broken;
/* set next start addr and walk over word */
broken[i] = s;
- while ((c=*++s) && !strchr(brksep, c) && !strchr(brkterm, c)) {
- continue;
+ while ((c = *++s)) {
+ if (brksep && strchr(brksep, c)) {
+ break;
+ }
+ if (brkterm && strchr(brkterm, c)) {
+ break;
+ }
}
}
adios("brkstring()", "reached unreachable point");