Skip to content

Commit

Permalink
dns: remove hsk_dns_name_alloc(): names are constant-length strings
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Jan 19, 2022
1 parent ba7af80 commit 5fe7c03
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
24 changes: 0 additions & 24 deletions src/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -2471,30 +2471,6 @@ hsk_dns_name_read_size(
return hsk_dns_name_parse((uint8_t **)&data, &data_len, dmp, NULL);
}

bool
hsk_dns_name_alloc(
uint8_t **data,
size_t *data_len,
const hsk_dns_dmp_t *dmp,
char **name
) {
int size = hsk_dns_name_read_size(*data, *data_len, dmp);

if (size == -1)
return false;

char *n = malloc(size + 1);

if (!n)
return false;

assert(hsk_dns_name_read(data, data_len, dmp, n));

*name = n;

return true;
}

bool
hsk_dns_name_dirty(const char *name) {
char *s = (char *)name;
Expand Down
8 changes: 0 additions & 8 deletions src/dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,6 @@ hsk_dns_name_read_size(
const hsk_dns_dmp_t *dmp
);

bool
hsk_dns_name_alloc(
uint8_t **data,
size_t *data_len,
const hsk_dns_dmp_t *dmp,
char **name
);

bool
hsk_dns_name_dirty(const char *name);

Expand Down

0 comments on commit 5fe7c03

Please sign in to comment.