From 34298120a3b660139b08a449ed56ab38c7dbe719 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 28 Nov 2011 18:27:23 +0000 Subject: - Off by 1 --- src/mesh/gnunet-service-mesh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index ce90b224c..8883602ab 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -1709,7 +1709,7 @@ path_add_to_peers (struct MeshPeerPath *p, int confirmed) unsigned int i; /* TODO: invert and add */ - for (i = 1; i < p->length && p->peers[i] != myid; i++) /* skip'em */; + for (i = 0; i < p->length && p->peers[i] != myid; i++) /* skip'em */; for (i++; i < p->length; i++) { struct MeshPeerInfo *aux; @@ -1717,7 +1717,7 @@ path_add_to_peers (struct MeshPeerPath *p, int confirmed) aux = peer_info_get_short(p->peers[i]); copy = path_duplicate(p); - copy->length = i; + copy->length = i + 1; peer_info_add_path(aux, copy, GNUNET_NO); } } -- cgit v1.2.3