]> git.meshlink.io Git - meshlink/commitdiff
Revert "Fixed a bug in the invitation code that prevented correct working of the...
authorSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 10:17:45 +0000 (12:17 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 11:29:41 +0000 (13:29 +0200)
This reverts commit 1b233d4c868011ec98b668d2d7fca576d921b8b6.

src/meshlink.c

index 1e2955ef2a02dc97b4e5926f6f70c173a4dfcc6f..30d71a2bef709136edf1cff2a296fd6a01f117f9 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, 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: