X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/008837e090c008e3afe7a9c8667070bafa091e62..e35fb433456859d250d2e075350d11d4e173713b:/sbr/brkstring.c diff --git a/sbr/brkstring.c b/sbr/brkstring.c index d2f71aa3..f0f43693 100644 --- a/sbr/brkstring.c +++ b/sbr/brkstring.c @@ -1,10 +1,6 @@ - -/* - * brkstring.c -- (destructively) split a string into +/* brkstring.c -- (destructively) split a string into * -- an array of substrings * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -61,7 +57,7 @@ brkstring (char *str, char *brksep, char *brkterm) if (!c || brkany (c, brkterm)) { *s = '\0'; broken[i] = NULL; - return broken; + break; } /* set next start addr */ @@ -71,7 +67,7 @@ brkstring (char *str, char *brksep, char *brkterm) ; /* empty body */ } - return broken; /* NOT REACHED */ + return broken; } @@ -83,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); }