From 2eadc6cb890de1890148e16c9b374241b7edc963 Mon Sep 17 00:00:00 2001 From: "Simon V. Lejel" Date: Sun, 18 Feb 2024 17:06:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20multiple=20messages=20on?= =?UTF-8?q?=20spaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/main.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/main.cc b/src/client/main.cc index 10ceff3..654e546 100644 --- a/src/client/main.cc +++ b/src/client/main.cc @@ -122,10 +122,9 @@ int main() { // Create a new message object Message message; - // FIXME Seems to send multiple messages if content contains spaces // Get the content of the message from the user cout << "Type message to server: "; - cin >> message.content; + std::getline(cin, message.content); // Exit the program if the user typed "exit" as the content of the // message