[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17743 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17743 - gnunet/src/dht |
Date: |
Tue, 25 Oct 2011 15:24:36 +0200 |
Author: grothoff
Date: 2011-10-25 15:24:36 +0200 (Tue, 25 Oct 2011)
New Revision: 17743
Modified:
gnunet/src/dht/gnunet-service-dht_neighbours.c
Log:
fix loop bounds
Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c 2011-10-25 12:57:18 UTC
(rev 17742)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c 2011-10-25 13:24:36 UTC
(rev 17743)
@@ -1065,7 +1065,7 @@
/* select "random" peer */
/* count number of peers that are available and not filtered */
count = 0;
- for (bc = closest_bucket; bc < MAX_BUCKETS; bc++)
+ for (bc = 0; bc < closest_bucket; bc++)
{
pos = k_buckets[bc].head;
while ((pos != NULL) && (count < bucket_size))
@@ -1100,7 +1100,7 @@
/* Now actually choose a peer */
selected = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, count);
count = 0;
- for (bc = closest_bucket; bc < MAX_BUCKETS; bc++)
+ for (bc = 0; bc < closest_bucket; bc++)
{
pos = k_buckets[bc].head;
while ((pos != NULL) && (count < bucket_size))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17743 - gnunet/src/dht,
gnunet <=