Commit 4c267f2a authored by Julien Dusser's avatar Julien Dusser Committed by Junio C Hamano

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: default avatarJulien Dusser <julien.dusser@free.fr>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 3013dff8
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment