Skip to content

Commit

Permalink
fix: correct port number validation and improve the information log f…
Browse files Browse the repository at this point in the history
…or IPv6 addresses
  • Loading branch information
MasterLaplace committed Dec 10, 2024
1 parent 996812c commit 6dd59b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Flakkari/ParseArgument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ParseArgument::ParseArgument(int ac, const char *av[])
else if (std::string(av[i]) == "-port")
{
_port = static_cast<unsigned short>(std::stoi(av[i + 1]));
if (_port < 1024 || (uint32_t)_port > 65535)
if (_port < 1024)
throw std::runtime_error("Invalid port number, must be between 1024 and 65535");
++i;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ bool ParseArgument::GetIPv6Addresses()
if (strcmp(addressBuffer, "::1") != 0)
{
_ip = addressBuffer;
FLAKKARI_LOG_INFO("Interface " + std::cout(ifa->ifa_name) + " a l'adresse IPv6 : " + _ip);
FLAKKARI_LOG_INFO("Interface " + std::string(ifa->ifa_name) + " a l'adresse IPv6 : " + _ip);
}
}

Expand Down

0 comments on commit 6dd59b5

Please sign in to comment.