]> diplodocus.org Git - nmh/blobdiff - sbr/brkstring.c
mhbuildsbr.c: Flip logic, moving goto to then-block; no need for else.
[nmh] / sbr / brkstring.c
index bdc8c30ac91cea9b10f80ebfe01e95fd5290fa5e..f0f43693695c26287ad9817c98027a00b035de56 100644 (file)
@@ -1,6 +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
@@ -81,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);
 }