diff options
author | Julien Dusser <julien.dusser@free.fr> | 2017-12-22 18:24:37 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-22 13:43:19 -0800 |
commit | 4c267f2ae37e5b5f834172f04b7dd4343e370689 (patch) | |
tree | ac5948b7a6ac5e2780b174083a2f01ad4331a8bd /strbuf.c | |
parent | 3013dff8662eae06457fe6e5348dfe2270810ab2 (diff) | |
download | git-4c267f2ae37e5b5f834172f04b7dd4343e370689.tar.gz |
strbuf: fix urlencode format string on signed charjd/fix-strbuf-add-urlencode-bytes
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } } |