summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hack.thebackupbox.net>2020-01-21 16:24:29 +0000
committerepoch <epoch@hack.thebackupbox.net>2020-01-21 16:24:29 +0000
commitd1d712299808f819634aa9938741de9d5cb38986 (patch)
tree6467257fc0dee0e932a6d44ec88ee15636ba7d43
parent8a8602011b11a4f53a96facd4d5dc0c0aed7b6a4 (diff)
downloaduritools-d1d712299808f819634aa9938741de9d5cb38986.tar.gz
uritools-d1d712299808f819634aa9938741de9d5cb38986.zip
small change that fixed uriescape I think. spaces were decoding into %00
-rw-r--r--uri.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/uri.h b/uri.h
index dc049bc..ab6fab8 100644
--- a/uri.h
+++ b/uri.h
@@ -38,7 +38,7 @@ int uriescapelength(char *in,int len) {
}
// make sure your out char * has enough space! use uriescapelength for it.
-void uriescape(char *in,char *out,int len) {
+void uriescape(unsigned char *in,char *out,int len) {
int i;
int j;
for(i=0,j=0;i<len;i++) {
@@ -48,7 +48,7 @@ void uriescape(char *in,char *out,int len) {
} else {
out[j]='%';
j++;
- out[j]="0123456789ABCDEF"[(in[i] >> 4 & 0x15)];
+ out[j]="0123456789ABCDEF"[((in[i] >> 4) % 16)];
j++;
out[j]="0123456789ABCDEF"[(in[i] % 16)];
j++;