From: Bart Polot Date: Wed, 1 Jun 2011 18:55:25 +0000 (+0000) Subject: Use better condition X-Git-Tag: initial-import-from-subversion-38251~18350 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1fea1c90365c01bf0e8d75ba148367ad4125f5d9;p=oweals%2Fgnunet.git Use better condition --- 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));