From: Adam Dickmeiss Date: Mon, 7 Jul 2008 07:25:28 +0000 (+0200) Subject: Changed sscanf in urldecode to use more portable scan-spec. X-Git-Tag: v1.0.10~12 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=4545327bcbca89a97696ef257c2a99e312291af1;p=pazpar2-moved-to-github.git 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. --- 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++);