]> git.meshlink.io Git - meshlink/commitdiff
Fixed a bug in the invitation code that prevented correct working of the feature...
authorSaverio Proto <zioproto@gmail.com>
Thu, 14 Aug 2014 13:48:32 +0000 (15:48 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 11:28:33 +0000 (13:28 +0200)
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

index 30d71a2bef709136edf1cff2a296fd6a01f117f9..1e2955ef2a02dc97b4e5926f6f70c173a4dfcc6f 100644 (file)
@@ -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: