Merge branch 'rm/strchrnul-not-strlen'
* rm/strchrnul-not-strlen: use strchrnul() in place of strchr() and strlen()
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user