summaryrefslogtreecommitdiff
path: root/ws.c
diff options
context:
space:
mode:
authorNicolas Zingilé <nicolas.zingile@open.eurogiciel.org>2014-11-17 17:01:18 +0100
committerNicolas Zingilé <nicolas.zingile@open.eurogiciel.org>2014-11-17 17:01:18 +0100
commit98e3d8faf9eebd382f62a75c886b7e1c6a20279b (patch)
tree756eb3879157731cb1c2b50f35a744aad8b8796d /ws.c
parentee5a57bc5c5641c30bc626892ddc31ddd18ed7ad (diff)
downloadgit-98e3d8faf9eebd382f62a75c886b7e1c6a20279b.tar.gz
git-98e3d8faf9eebd382f62a75c886b7e1c6a20279b.tar.bz2
git-98e3d8faf9eebd382f62a75c886b7e1c6a20279b.zip
Imported Upstream version 2.0.1upstream/2.0.1
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 b498d759..ea4b2b1d 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;