]> diplodocus.org Git - nmh/blobdiff - sbr/brkstring.c
Removed version number from OpenBSD, it's in the "recent" section.
[nmh] / sbr / brkstring.c
index 8b577dbed6ba06561910029d1c26d7f3ffc10442..8f1c297fab69ed4b28ee05b07fc4109f1afaf594 100644 (file)
@@ -6,8 +6,9 @@
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "brkstring.h"
+#include "h/utils.h"
 
 /* allocate this number of pointers at a time */
 #define NUMBROKEN 256
@@ -30,7 +31,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)));
     }
 
     /*
@@ -79,12 +80,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);
 }