util.c | util.c | |||
---|---|---|---|---|
skipping to change at line 1690 | skipping to change at line 1690 | |||
} | } | |||
char *xescape(const char *s, const char *bad) { | char *xescape(const char *s, const char *bad) { | |||
char *r, *t; | char *r, *t; | |||
const char *f; | const char *f; | |||
/* Escapes all chars in bad, in addition to \ and all special | /* Escapes all chars in bad, in addition to \ and all special | |||
* chars, in \xFF style escaping. May be reversed with | * chars, in \xFF style escaping. May be reversed with | |||
* cunescape. */ | * cunescape. */ | |||
if (!(r = new(char, strlen(s)*4+1))) | r = new(char, strlen(s) * 4 + 1); | |||
if (!r) | ||||
return NULL; | return NULL; | |||
for (f = s, t = r; *f; f++) { | for (f = s, t = r; *f; f++) { | |||
if ((*f < ' ') || (*f >= 127) || | if ((*f < ' ') || (*f >= 127) || | |||
(*f == '\\') || strchr(bad, *f)) { | (*f == '\\') || strchr(bad, *f)) { | |||
*(t++) = '\\'; | *(t++) = '\\'; | |||
*(t++) = 'x'; | *(t++) = 'x'; | |||
*(t++) = hexchar(*f >> 4); | *(t++) = hexchar(*f >> 4); | |||
*(t++) = hexchar(*f); | *(t++) = hexchar(*f); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |