]> diplodocus.org Git - nmh/blobdiff - sbr/brkstring.c
Delete "blank" lines at start of files to bring content into view.
[nmh] / sbr / brkstring.c
index 49d5f9d8d66262aee1f4bf8b1bb0cbbc37f53db2..0f7c17fce4e0a966d6e48d0853675f1f5c4e336c 100644 (file)
@@ -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);
 }