fix offset computation in flat iterator
authorChristian Grothoff <christian@grothoff.org>
Wed, 9 May 2018 16:12:19 +0000 (18:12 +0200)
committerChristian Grothoff <christian@grothoff.org>
Wed, 9 May 2018 16:12:19 +0000 (18:12 +0200)
src/namestore/plugin_namestore_flat.c

index c464d4e680d610a5facff54d2f4a78777df5efb1..35d8424b42d58943da2a8cd7e3de6bb2fffc6bbb 100644 (file)
@@ -573,7 +573,6 @@ iterate_zones (void *cls,
   struct FlatFileEntry *entry = value;
 
   (void) key;
-  ic->pos++;
   if (0 == ic->limit)
     return GNUNET_NO;
   if ( (NULL != ic->zone) &&
@@ -581,6 +580,7 @@ iterate_zones (void *cls,
                      ic->zone,
                      sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
     return GNUNET_YES;
+  ic->pos++;
   if (ic->offset > 0)
   {
     ic->offset--;