| 156 | } |
| 157 | |
| 158 | void decodeurl(unsigned char *s, int allowcr){ |
| 159 | unsigned char *d = s; |
| 160 | unsigned u; |
| 161 | |
| 162 | while(*s){ |
| 163 | if(*s == '%' && ishex(s[1]) && ishex(s[2])){ |
| 164 | sscanf((char *)s+1, "%2x", &u); |
| 165 | if(allowcr && u != '\r')*d++ = u; |
| 166 | else if (u != '\r' && u != '\n') { |
| 167 | if (u == '\"' || u == '\\') *d++ = '\\'; |
| 168 | else if (u == 255) *d++ = 255; |
| 169 | *d++ = u; |
| 170 | } |
| 171 | s+=3; |
| 172 | } |
| 173 | else if(!allowcr && *s == '?') { |
| 174 | break; |
| 175 | } |
| 176 | else if(*s == '+') { |
| 177 | *d++ = ' '; |
| 178 | s++; |
| 179 | } |
| 180 | else { |
| 181 | *d++ = *s++; |
| 182 | } |
| 183 | } |
| 184 | *d = 0; |
| 185 | } |
| 186 | |
| 187 | void file2url(unsigned char *sb, unsigned char *buf, unsigned bufsize, int * inbuf, int skip255){ |
| 188 | for(; *sb; sb++){ |
no outgoing calls
no test coverage detected