From 6329c2fb516974c72fb7fb4f29ec017b90cfda46 Mon Sep 17 00:00:00 2001 From: Pablo Mellado Date: Thu, 23 Jun 2022 13:36:24 +0200 Subject: [PATCH] Fix bug when the previous data sent was smaller There is a bug when you send some data, and then in a second communication with smaller data you can see at the end of the the previous last part of the larger data. Then the size obtained is the same in both cases. --- src/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index ebaf9fe..ea51923 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -71,7 +71,7 @@ void Client::receiveTask() { publishEvent(ClientEvent::DISCONNECTED, disconnectionMessage); return; } else { - publishEvent(ClientEvent::INCOMING_MSG, receivedMessage); + publishEvent(ClientEvent::INCOMING_MSG, std::string(receivedMessage, numOfBytesReceived)); } } }