Tweaks to previous, DNS label charset commit.

This commit is contained in:
Simon Kelley
2015-04-22 21:14:31 +01:00
parent cbe379ad6b
commit b8f16556d3
4 changed files with 30 additions and 12 deletions

View File

@@ -341,9 +341,11 @@ static int to_wire(char *name)
if (*p >= 'A' && *p <= 'Z')
*p = *p - 'A' + 'a';
else if (*p == NAME_ESCAPE)
for (q = p; *q; q++)
{
for (q = p; *q; q++)
*q = *(q+1);
(*p)--;
}
term = *p;
if ((len = p - l) != 0)
@@ -376,7 +378,8 @@ static void from_wire(char *name)
{
memmove(p+1, p, 1 + last - p);
len++;
*p++ = NAME_ESCAPE;
*p++ = NAME_ESCAPE;
(*p)++;
}
l[len] = '.';