]> diplodocus.org Git - nmh/commitdiff
sbr/brkstring.c: Use strchr(3) in brkany(), not own loop.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 29 May 2017 12:20:00 +0000 (13:20 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 29 May 2017 12:20:00 +0000 (13:20 +0100)
sbr/brkstring.c

index 8b577db..f0f4369 100644 (file)
@@ -79,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);
 }