From 6dd59b5c8fcbd2522598af15a249952cb94c1c22 Mon Sep 17 00:00:00 2001 From: MasterLaplace Date: Mon, 9 Dec 2024 21:28:54 -0500 Subject: [PATCH] fix: correct port number validation and improve the information log for IPv6 addresses --- Flakkari/ParseArgument.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flakkari/ParseArgument.cpp b/Flakkari/ParseArgument.cpp index 8a580c2..906423c 100644 --- a/Flakkari/ParseArgument.cpp +++ b/Flakkari/ParseArgument.cpp @@ -35,7 +35,7 @@ ParseArgument::ParseArgument(int ac, const char *av[]) else if (std::string(av[i]) == "-port") { _port = static_cast(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; } @@ -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); } }