From 9b4faa262c944c0f215f7578f2079500e175afc2 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Thu, 14 Aug 2014 15:48:32 +0200 Subject: [PATCH] Fixed a bug in the invitation code that prevented correct working of the feature after the second call of /join The second time /join was called the correct name in meshlink.conf was not updated. It appeared a wrong ConnectTo statement in the hosts/name file --- src/meshlink.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/meshlink.c b/src/meshlink.c index 30d71a2b..1e2955ef 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, mesh->thedatalen + len + 1); - memcpy(mesh->data + mesh->thedatalen, msg, len); - mesh->thedatalen += len; - mesh->data[mesh->thedatalen] = 0; + mesh->data = xrealloc(mesh->data, len + 1); + memcpy(mesh->data , msg, len); + mesh->thedatalen = len; + //mesh->data[mesh->thedatalen] = 0; break; case 1: -- 2.39.2