X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0a032eea07f6d77ac6ea4d5a39c9491c34358058..94187a80bd60baab4b9c4b949ad820d730578123:/sbr/brkstring.c diff --git a/sbr/brkstring.c b/sbr/brkstring.c index 49d5f9d8..0f7c17fc 100644 --- a/sbr/brkstring.c +++ b/sbr/brkstring.c @@ -1,5 +1,4 @@ -/* - * 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 @@ -31,7 +30,7 @@ brkstring (char *str, char *brksep, char *brkterm) /* allocate initial space for pointers on first call */ if (!broken) { len = NUMBROKEN; - broken = (char **) mh_xmalloc ((size_t) (len * sizeof(*broken))); + broken = mh_xmalloc ((size_t) (len * sizeof(*broken))); } /* @@ -80,12 +79,5 @@ brkstring (char *str, char *brksep, char *brkterm) 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); }