git-am.sh: use the $(...) construct for command substitution
[gitweb.git] / ws.c
diff --git a/ws.c b/ws.c
index b498d7599d5ac09c2688ee829b29aa36a866ac9c..ea4b2b1dfd64ce41f4752a93f4d5478c4e53deda 100644 (file)
--- a/ws.c
+++ b/ws.c
@@ -33,11 +33,8 @@ unsigned parse_whitespace_rule(const char *string)
                int negated = 0;
 
                string = string + strspn(string, ", \t\n\r");
-               ep = strchr(string, ',');
-               if (!ep)
-                       len = strlen(string);
-               else
-                       len = ep - string;
+               ep = strchrnul(string, ',');
+               len = ep - string;
 
                if (*string == '-') {
                        negated = 1;