aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-12-13 11:41:38 +0000
committerBart Polot <bart@net.in.tum.de>2012-12-13 11:41:38 +0000
commitcd5607e7d8566687aa0ac1ca10b91543ebd16c89 (patch)
treee8bf30ff2828bc77e8561b1709ecf89537e6726a
parentaf69da485fd33e58fb827c0686e77f63cf5702c2 (diff)
- use correct size for message
-rw-r--r--src/mesh/mesh_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 7564a7ec58..cdc551f3dd 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -1843,7 +1843,7 @@ GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
offset = 0;
do
{
- msgsize = (len > offset + payload) ? payload : len;
+ msgsize = (len - offset > payload) ? payload : len - offset;
memcpy (&msg[1], &regex[offset], msgsize);
offset += msgsize;
msgsize += sizeof(struct GNUNET_MESH_RegexAnnounce);