[OpenSIPS-Devel] [opensips] Non printable characters are encoded in hex format (#623)

Răzvan Crainea notifications at github.com
Fri Aug 28 13:38:57 CEST 2015


> +		j++;
> +	}
> +	*at = 0;
> +	sout->len = at - sout->s;
> +
> +	return 0;
> +}
> +
> +static int encode_string(str *dst, str *src)
> +{
> +	unsigned char x;
> +	int j = 0;
> +	char *at = dst->s;
> +	char *p = src->s;
> +	while (j <= src->len) {
> +		if (*p < 32 || *p > 127 || *p == '#' || *p == '|' || *p == '\\') {

127 is not printable, so it should be caught by this branch. You could test *p against 127, (*p == 127), since *p can never be greater than 127 (max char).

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/623/files#r38191595
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150828/4ec014ff/attachment.htm>


More information about the Devel mailing list