349 |
unsigned char *out; |
unsigned char *out; |
350 |
int out_length, out_pos; |
int out_length, out_pos; |
351 |
|
|
352 |
out_length = strlen ((char *)string) + 1; |
out_length = (strlen ((char *)string) * 2) + 1; |
353 |
out = (unsigned char *)malloc (out_length); |
out = (unsigned char *)malloc (out_length); |
354 |
if (!out) |
if (!out) |
355 |
return NULL; |
return NULL; |
363 |
string++; |
string++; |
364 |
switch (string[0]) |
switch (string[0]) |
365 |
{ |
{ |
366 |
|
case '\0': |
367 |
|
out[out_pos++] = '%'; |
368 |
|
break; |
369 |
case '%': /* double '%' replaced by single '%' */ |
case '%': /* double '%' replaced by single '%' */ |
370 |
out[out_pos++] = string[0]; |
out[out_pos++] = string[0]; |
371 |
string++; |
string++; |