]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Fixed a bug in the invitation code that prevented correct working of the feature...
[meshlink] / 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: