Re: [PATCH] archive: simplify refname handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



René Scharfe <rene.scharfe@xxxxxxxxxxxxxx> writes:

> +		const char *colon = strchr(name, ':');
> +		size_t refnamelen = colon ? colon - name : strlen(name);
> +
> +		if (!dwim_ref(name, refnamelen, sha1, &ref))
> +			die("no such ref: %.*s", refnamelen, name);
>  		free(ref);
>  	}

Both dwim_ref()'s second parameter the vararg that corresponds to the
length part of "%.*s" in die(), expect "int", not "size_t", so I needed
this to get it compile.

 archive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/archive.c b/archive.c
index 081ecb5..1e7156d 100644
--- a/archive.c
+++ b/archive.c
@@ -261,7 +261,7 @@ static void parse_treeish_arg(const char **argv,
 	if (remote) {
 		char *ref = NULL;
 		const char *colon = strchr(name, ':');
-		size_t refnamelen = colon ? colon - name : strlen(name);
+		int refnamelen = colon ? colon - name : strlen(name);
 
 		if (!dwim_ref(name, refnamelen, sha1, &ref))
 			die("no such ref: %.*s", refnamelen, name);


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]