Merge branch 'master' of github.com:Namonay/42_irc

This commit is contained in:
2024-01-30 17:16:04 +01:00
3 changed files with 79 additions and 79 deletions

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/20 09:27:04 by maldavid #+# #+# */
/* Updated: 2024/01/30 00:43:49 by maldavid ### ########.fr */
/* Updated: 2024/01/30 17:16:04 by vvaas ### ########.fr */
/* */
/******************************************************************************/
@@ -23,8 +23,8 @@ static irc::Server* serv_ptr = NULL;
void signalsHandler(int foo)
{
(void)foo;
if(!serv_ptr)
return;
if (!serv_ptr)
return ;
serv_ptr->closeMainSocket();
std::cout << "\b\b \b\b" << std::flush;
irc::logs::report(irc::log_message, "Shutting down...");
@@ -32,17 +32,17 @@ void signalsHandler(int foo)
int main(int ac, char** av)
{
if(ac != 3)
if (ac != 3)
{
irc::logs::report(irc::log_message, "usage './ircserv <port> <password>', try again dumbass");
return 0;
}
if(av[1] == NULL || av[2] == NULL)
if (av[1] == NULL || av[2] == NULL)
irc::logs::report(irc::log_fatal_error, "invalid argv, argv[1] or argv[2] is NULL (wtf)");
char* end;
int port = std::strtol(av[1], &end, 10);
if(errno == ERANGE || *end != 0 || port < 0 || port > 0xFFFF || std::strlen(av[1]) == 0)
if (errno == ERANGE || *end != 0 || port < 0 || port > 0xFFFF || std::strlen(av[1]) == 0)
irc::logs::report(irc::log_fatal_error, "invalid port");
irc::Server serv(port, av[2]);