diff options
-rw-r--r-- | uri.h | 4 | ||||
-rw-r--r-- | uriescape.c | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -28,7 +28,7 @@ char *uri_reserved={ pe_HPUT }; -int uriescapelength(char *in,int len) { +int uriescapelength(unsigned char *in,int len) { int rlen=0;//be sure to add one to this return value if you plan on putting a null byte at the end. int i; for(i=0;i<len;i++) { @@ -38,7 +38,7 @@ int uriescapelength(char *in,int len) { } // make sure your out char * has enough space! use uriescapelength for it. -void uriescape(unsigned char *in,char *out,int len) { +void uriescape(unsigned char *in,unsigned char *out,int len) { int i; int j; for(i=0,j=0;i<len;i++) { diff --git a/uriescape.c b/uriescape.c index da3da7e..ccf90cb 100644 --- a/uriescape.c +++ b/uriescape.c @@ -3,11 +3,11 @@ int main(int argc,char *argv[]) { int len; - char *out; + unsigned char *out; if(argc < 2) return 1; - len=uriescapelength(argv[1],strlen(argv[1])); + len=uriescapelength((unsigned char *)argv[1],strlen(argv[1])); out=malloc(len+1); - uriescape(argv[1],out,len); + uriescape((unsigned char *)argv[1],out,len); out[len]=0; printf("%s\n",out); return 0; |