Handle high-range characters when URL encoding.
authorScott Cantor <cantor.2@osu.edu>
Thu, 30 Nov 2006 17:58:10 +0000 (17:58 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 30 Nov 2006 17:58:10 +0000 (17:58 +0000)
shib-target/shib-handlers.cpp

index 2f0d65d..ec5b1d3 100644 (file)
@@ -544,8 +544,8 @@ string CgiParse::url_encode(const char* s)
     for (; *s; s++) {
         if (strchr(badchars,*s) || *s<=0x20 || *s>=0x7F) {
             ret+='%';
-        ret+=hexchar(*s >> 4);
-        ret+=hexchar(*s & 0x0F);
+            ret+=hexchar((unsigned char)*s >> 4);
+            ret+=hexchar((unsigned char)*s & 0x0F);
         }
         else
             ret+=*s;