Skip to content

Commit

Permalink
Namespace types
Browse files Browse the repository at this point in the history
  • Loading branch information
cziter15 committed Feb 4, 2025
1 parent 6628ee4 commit 84b7d46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ksf/ksDomainQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace ksf
udp->write(uint8_t{0x00}); udp->write(uint8_t{0x00}); // No additional

/* Prcess domain name. */
for (size_t start{0}, pos = 0; ; start = pos + 1)
for (std::size_t start{0}, pos = 0; ; start = pos + 1)
{
pos = domain.find('.', start);
if (pos == std::string::npos)
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace ksf

/* Read the UDP packet. */
uint8_t buffer[512];
auto len{static_cast<size_t>(udp->read(buffer, sizeof(buffer)))};
auto len{static_cast<std::size_t>(udp->read(buffer, sizeof(buffer)))};
if (len < 12)
return;

Expand All @@ -123,13 +123,13 @@ namespace ksf
Start after the header (12 bytes), then skip the QNAME (until a null byte),
and finally skip the null terminator, QTYPE (2 bytes), and QCLASS (2 bytes).
*/
size_t pos = 12;
std::size_t pos{12};
while (pos < len && buffer[pos] != 0)
pos++;
pos += 5;

/* Process the answers. */
for (size_t i{0}; i < answerCount; i++)
for (std::size_t i{0}; i < answerCount; i++)
{
/*
Skip name pointers if present.
Expand Down

0 comments on commit 84b7d46

Please sign in to comment.