Skip to content

[Question] is dns_domain_length() really working? #5

@pierre-rouleau

Description

@pierre-rouleau

Hi @henryk, thanks for this repo.

The file dns_domain.c has some code that puzzles me. I might be tired, but that code does not seem to work:

unsigned int dns_domain_length(const char *dn)
{
  const char *x;
  unsigned char c;

  x = dn;
  while (c = *x++)
    x += (unsigned int) c;
  return x - dn;
}

Why is this adding the value of the c to the pointer x? is dn pointing to some sort of structure that is not a real C string, a sequence of characters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions