Skip to content

Commit

Permalink
dns: (temp) remove internal byte codes 0xff and 0xfe
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Nov 29, 2021
1 parent 4f8e851 commit b7fc1c6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -2131,15 +2131,15 @@ hsk_dns_name_parse(
for (j = off; j < off + c; j++) {
uint8_t b = data[j];

// Hack because we're
// using c-strings.
if (b == 0x00)
b = 0xff;
// // Hack because we're
// // using c-strings.
// if (b == 0x00)
// b = 0xff;

// This allows for double-dots
// too easily in our design.
if (b == 0x2e)
b = 0xfe;
// // This allows for double-dots
// // too easily in our design.
// if (b == 0x2e)
// b = 0xfe;

if (name)
name[noff] = b;
Expand Down Expand Up @@ -2299,13 +2299,13 @@ hsk_dns_name_serialize(
continue;
}

// 0xff -> NUL
if (ch == -1)
ch = '\0';
// // 0xff -> NUL
// if (ch == -1)
// ch = '\0';

// 0xfe -> .
if (ch == -2)
ch = '.';
// // 0xfe -> .
// if (ch == -2)
// ch = '.';

data[off++] = ch;
}
Expand Down

0 comments on commit b7fc1c6

Please sign in to comment.