aboutsummaryrefslogtreecommitdiffstats
path: root/strbuf.c
diff options
context:
space:
mode:
authorJulien Dusser <julien.dusser@free.fr>2017-12-22 18:24:37 +0100
committerJunio C Hamano <gitster@pobox.com>2017-12-22 13:43:19 -0800
commit4c267f2ae37e5b5f834172f04b7dd4343e370689 (patch)
treeac5948b7a6ac5e2780b174083a2f01ad4331a8bd /strbuf.c
parent3013dff8662eae06457fe6e5348dfe2270810ab2 (diff)
downloadgit-4c267f2ae37e5b5f834172f04b7dd4343e370689.tar.gz
strbuf: fix urlencode format string on signed char
Git credential fails with special char in password with remote: Invalid username or password. fatal: Authentication failed for File ~/.git-credential contains badly urlencoded characters %ffffffXX%ffffffYY instead of %XX%YY. Add a cast to an unsigned char to fix urlencode use of %02x on a char. Signed-off-by: Julien Dusser <julien.dusser@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strbuf.c b/strbuf.c
index 323c49ceb3..4d5a9ce551 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -658,7 +658,7 @@ static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
(!reserved && is_rfc3986_reserved(ch)))
strbuf_addch(sb, ch);
else
- strbuf_addf(sb, "%%%02x", ch);
+ strbuf_addf(sb, "%%%02x", (unsigned char)ch);
}
}