From: Bart Polot Date: Mon, 28 Nov 2011 18:27:23 +0000 (+0000) Subject: - Off by 1 X-Git-Tag: initial-import-from-subversion-38251~15764 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=34298120a3b660139b08a449ed56ab38c7dbe719;p=oweals%2Fgnunet.git - Off by 1 --- 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); } }