aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/escape.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/escape.c b/lib/escape.c
index 048fd0f99..74d8deea8 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -100,7 +100,7 @@ char *curl_unescape(char *string, int length)
the "query part" where '+' should become ' '.
RFC 2316, section 3.10 */
- while(--alloc) {
+ while(--alloc > 0) {
in = *string;
if(querypart && ('+' == in))
in = ' ';
@@ -113,6 +113,7 @@ char *curl_unescape(char *string, int length)
if(sscanf(string+1, "%02X", &hex)) {
in = hex;
string+=2;
+ alloc-=2;
}
}