summaryrefslogtreecommitdiff
path: root/diff.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 /diff.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 'diff.c')
-rw-r--r--diff.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/diff.c b/diff.c
index 9ae8116fca..e343191bda 100644
--- a/diff.c
+++ b/diff.c
@@ -3362,14 +3362,11 @@ static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *va
if (c != '-')
return 0;
arg++;
- eq = strchr(arg, '=');
- if (eq)
- len = eq - arg;
- else
- len = strlen(arg);
+ eq = strchrnul(arg, '=');
+ len = eq - arg;
if (!len || strncmp(arg, arg_long, len))
return 0;
- if (eq) {
+ if (*eq) {
int n;
char *end;
if (!isdigit(*++eq))