Someone
public text v1 · immutablevoid replace_hex_with_ascii(char * string) {
int i = 0;
int ii = 0;
int length = strlen(string);
char code[5], *end;
code[0] = '0';
code[1] = 'x';
code[4] = 0;
for (i = 0; i < length; i++) {
if (string[i] == '%') {
code[2] = string[i+1];
code[3] = string[i+2];
string[i] = strtol(code, &end, 16);
for (ii = ++i; ii < length; ii++) {
string[ii] = string[ii+2];
}
length -= 2;
}
}
}