From d1805f2309267d3ad68d93424909263729dbd8b4 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Wed, 6 Dec 2023 16:20:59 -0500 Subject: [PATCH] Pleurer en chat. --- SQCSim-common/netprotocol.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SQCSim-common/netprotocol.cpp b/SQCSim-common/netprotocol.cpp index 792364b..5bad78b 100644 --- a/SQCSim-common/netprotocol.cpp +++ b/SQCSim-common/netprotocol.cpp @@ -925,14 +925,16 @@ bool netprot::Deserialize(Chat* chat, char* buf, uint32_t *buflen) { (uint64_t)dstt[6] << 8 | (uint64_t)dstt[7]; - size_t messsize = std::strlen(buf + sizeof(uint64_t) * 3) + 1; + size_t messsize = std::strlen(&buf[sizeof(uint64_t) * 3]) + 1; if (messsize > 140) return false; + std::cout << messsize << ": " << &buf[1 + sizeof(uint64_t) * 3] << std::endl; + strcpy(chat->mess, messsize, &buf[1 + sizeof(uint64_t) * 3]); - *buflen = messsize + sizeof(uint64_t) * 3 + 1; + //*buflen = messsize + sizeof(uint64_t) * 3 + 1; return true; }