summaryrefslogtreecommitdiff
path: root/ws.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-18 13:51:18 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-18 13:51:18 -0700
commit6f75e48323bc3071495025fd14105e9dffa9e8dd (patch)
treefbb3b54f3877d21bc6a9ac6c284971581e18274b /ws.c
parent884377c128925e7aa43eafebd8d4d0ba27dafe67 (diff)
parent2c5495f7b60d6ddcd6a411b48d2f6dbc4a24717a (diff)
downloadgit-6f75e48323bc3071495025fd14105e9dffa9e8dd.tar.gz
Merge branch 'rm/strchrnul-not-strlen'
* rm/strchrnul-not-strlen: use strchrnul() in place of strchr() and strlen()
Diffstat (limited to 'ws.c')
-rw-r--r--ws.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ws.c b/ws.c
index b498d7599d..ea4b2b1dfd 100644
--- 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;