From a9fccfb90479597e554f05ed71bf7bdcc7837ca5 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 26 Aug 2011 20:09:54 +0000 Subject: Fixed API test case --- src/mesh/mesh_api_new.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesh/mesh_api_new.c') diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c index e2455fac5..0540c765b 100644 --- a/src/mesh/mesh_api_new.c +++ b/src/mesh/mesh_api_new.c @@ -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); -- cgit v1.2.3