From: Saverio Proto Date: Sun, 17 Aug 2014 10:17:45 +0000 (+0200) Subject: Revert "Fixed a bug in the invitation code that prevented correct working of the... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=225796b0f46f9c21ef83833057720f66621e4c48;p=meshlink Revert "Fixed a bug in the invitation code that prevented correct working of the feature after the second call of /join" This reverts commit 1b233d4c868011ec98b668d2d7fca576d921b8b6. --- diff --git a/src/meshlink.c b/src/meshlink.c index 1e2955ef..30d71a2b 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -549,10 +549,10 @@ static bool invitation_receive(void *handle, uint8_t type, const void *msg, uint return sptps_send_record(&(mesh->sptps), 0, mesh->cookie, sizeof mesh->cookie); case 0: - mesh->data = xrealloc(mesh->data, len + 1); - memcpy(mesh->data , msg, len); - mesh->thedatalen = len; - //mesh->data[mesh->thedatalen] = 0; + mesh->data = xrealloc(mesh->data, mesh->thedatalen + len + 1); + memcpy(mesh->data + mesh->thedatalen, msg, len); + mesh->thedatalen += len; + mesh->data[mesh->thedatalen] = 0; break; case 1: