From 1fea1c90365c01bf0e8d75ba148367ad4125f5d9 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 1 Jun 2011 18:55:25 +0000 Subject: [PATCH] Use better condition --- src/mesh/mesh_api_new.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/mesh_api_new.c b/src/mesh/mesh_api_new.c index c9c71405c..2faaf9c7b 100644 --- a/src/mesh/mesh_api_new.c +++ b/src/mesh/mesh_api_new.c @@ -225,12 +225,12 @@ send_connect_packet (void *cls, size_t size, void *buf) msg = (struct GNUNET_MESH_ClientConnect *) buf; msg->header.type = htons(GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT); - for (ntypes = 0, types = NULL; h->message_handlers[ntypes].type; ntypes++) { + for (ntypes = 0, types = NULL; ntypes < h->n_handlers; ntypes++) { types = GNUNET_realloc(types, sizeof(uint16_t) * (ntypes + 1)); types[ntypes] = h->message_handlers[ntypes].type; } - for(napps = 0, apps = NULL; h->applications[napps]; napps++) { + for(napps = 0, apps = NULL; napps < h->n_applications; napps++) { apps = GNUNET_realloc(apps, sizeof(GNUNET_MESH_ApplicationType) * (napps + 1)); -- 2.25.1