summaryrefslogtreecommitdiff
path: root/archive.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 /archive.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 'archive.c')
-rw-r--r--archive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archive.c b/archive.c
index 7d0976fe55..3fc0fb2928 100644
--- a/archive.c
+++ b/archive.c
@@ -260,8 +260,8 @@ static void parse_treeish_arg(const char **argv,
/* Remotes are only allowed to fetch actual refs */
if (remote && !remote_allow_unreachable) {
char *ref = NULL;
- const char *colon = strchr(name, ':');
- int refnamelen = colon ? colon - name : strlen(name);
+ const char *colon = strchrnul(name, ':');
+ int refnamelen = colon - name;
if (!dwim_ref(name, refnamelen, sha1, &ref))
die("no such ref: %.*s", refnamelen, name);