From c94837e9dc2c079d089072c04b58b6fa9dc358aa Mon Sep 17 00:00:00 2001 From: Samy BEN TAYEB Date: Thu, 19 Jun 2025 11:44:32 +0200 Subject: [PATCH] execute function segfault fixed --- sources/commands/commands.cpp | 3 ++- sources/commands/list.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sources/commands/commands.cpp b/sources/commands/commands.cpp index 806e075..b4be57d 100644 --- a/sources/commands/commands.cpp +++ b/sources/commands/commands.cpp @@ -143,7 +143,8 @@ void cmd::dispatch(::User *user, Channel *channel, Server *server, std::string & case 't': if (command_name == "topic") { Topic(user, channel, server, line).execute(); - } + } + break; case 'w': if (command_name == "whois") { Whois(user, channel, server, line).execute(); diff --git a/sources/commands/list.cpp b/sources/commands/list.cpp index c8efd6d..4607172 100644 --- a/sources/commands/list.cpp +++ b/sources/commands/list.cpp @@ -6,7 +6,7 @@ /* By: sben-tay +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/24 17:29:48 by rparodi #+# #+# */ -/* Updated: 2025/06/19 11:21:59 by rparodi ### ########.fr */ +/* Updated: 2025/06/19 11:42:56 by sben-tay ### ########.fr */ /* */ /* ************************************************************************** */ @@ -51,7 +51,7 @@ void List::execute() { std::ostringstream msg322; msg322 << ":localhost 322 " << _sender->getNickname() << " " << (*it)->getName() << " " << (*it)->getUsers().size() << - " :" << _channel->getTopic() << "\r\n"; + " :" << (*it)->getTopic() << "\r\n"; this->_sender->appendToWriteBuffer(msg322.str()); } }