Pleurer en chat.

This commit is contained in:
MarcEricMartel 2023-12-06 16:20:59 -05:00
parent 449e12ca5a
commit d1805f2309

View File

@ -925,14 +925,16 @@ bool netprot::Deserialize(Chat* chat, char* buf, uint32_t *buflen) {
(uint64_t)dstt[6] << 8 | (uint64_t)dstt[6] << 8 |
(uint64_t)dstt[7]; (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) if (messsize > 140)
return false; return false;
std::cout << messsize << ": " << &buf[1 + sizeof(uint64_t) * 3] << std::endl;
strcpy(chat->mess, messsize, &buf[1 + sizeof(uint64_t) * 3]); 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; return true;
} }