This commit is contained in:
Kbz-8
2024-01-21 10:40:54 +01:00
parent 4374f826ea
commit 488c0ad83c
8 changed files with 139 additions and 6 deletions

View File

@@ -6,11 +6,16 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/20 09:27:04 by maldavid #+# #+# */
/* Updated: 2024/01/21 09:30:55 by maldavid ### ########.fr */
/* Updated: 2024/01/21 10:31:26 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include <logs.hpp>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cerrno>
#include <server.hpp>
int main(int ac, char** av)
{
@@ -19,6 +24,15 @@ int main(int ac, char** av)
irc::logs::report(irc::log_message, "usage './ircserv <port> <password>', try again dumbass");
return 0;
}
(void)av;
if(av[1] == NULL || av[2] == NULL)
irc::logs::report(irc::log_fatal_error, "invalid argv, one is NULL (wtf)");
char* end;
long port = std::strtol(av[1], &end, 10);
if(errno == ERANGE || *end != 0 || port < 0 || port > 0xffff)
irc::logs::report(irc::log_fatal_error, "invalid port");
irc::Server server(port, av[2]);
return 0;
}