Fixed API test case
authorBart Polot <bart@net.in.tum.de>
Fri, 26 Aug 2011 20:09:54 +0000 (20:09 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 26 Aug 2011 20:09:54 +0000 (20:09 +0000)
src/mesh/mesh_api_new.c

index e2455fac53432c45a999d96aa14697d9aaa04f41..0540c765ba132cc16f544b8b1d66ff85712226ea 100644 (file)
@@ -450,10 +450,9 @@ send_connect_packet (void *cls, size_t size, void *buf)
         htons (sizeof (struct GNUNET_MESH_ClientConnect) +
                 sizeof (uint16_t) * ntypes +
                 sizeof (GNUNET_MESH_ApplicationType) * napps);
-
     memcpy (&msg[1], types, sizeof (uint16_t) * ntypes);
-    memcpy (&msg[1] + sizeof (uint16_t) * ntypes, apps,
-            sizeof (GNUNET_MESH_ApplicationType) * napps);
+    types = (uint16_t *) &msg[1];
+    memcpy (&types[ntypes], apps, sizeof (GNUNET_MESH_ApplicationType) * napps);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "mesh: Sent %lu bytes long message %d types and %d apps\n",
                 ntohs (msg->header.size), ntypes, napps);