From 4545327bcbca89a97696ef257c2a99e312291af1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 7 Jul 2008 09:25:28 +0200 Subject: [PATCH] Changed sscanf in urldecode to use more portable scan-spec. Changed sscanf in urldecode to use more portable scan spec. This fixes the %XX decoding on Windows. --- src/http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/http.c b/src/http.c index 642465f..ec72838 100644 --- a/src/http.c +++ b/src/http.c @@ -230,12 +230,13 @@ static void urldecode(char *i, char *o) *(o++) = ' '; i++; } - else if (*i == '%') + else if (*i == '%' && i[1] && i[2]) { + int v; i++; - sscanf(i, "%2hhx", o); + sscanf(i, "%2x", &v); + *o++ = v; i += 2; - o++; } else *(o++) = *(i++); -- 1.7.10.4