]> Savannah Git Hosting - gnulib.git/commitdiff
bitset: be sure to always return a value
authorAkim Demaille <akim.demaille@gmail.com>
Wed, 18 Nov 2020 06:27:52 +0000 (07:27 +0100)
committerAkim Demaille <akim.demaille@gmail.com>
Thu, 19 Nov 2020 06:01:21 +0000 (07:01 +0100)
* lib/bitset/array.c (abitset_small_list): Always update *next and
return a value.

ChangeLog
lib/bitset/array.c

index 52524da5417a5196680e28d0f1531769dd96e40c..2bb8ae12390c5638f9bcd5bcf9056a18f48c5879 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-11-19  Akim Demaille  <akim@lrde.epita.fr>
+
+       bitset: be sure to always return a value
+       * lib/bitset/array.c (abitset_small_list): Always update *next and
+       return a value.
+
 2020-11-19  Siddhesh Poyarekar  <siddhesh@gotplt.org>
 
        vcs-to-changelog: Expect spaces in file names
index 3f8bcca87d3d58cc4f3f89a6d993e29ed7fa5a41..0e90b6b1fe8c7a7865a3bf7eb8ecbdf49a04a2ae 100644 (file)
@@ -65,12 +65,8 @@ abitset_small_list (bitset src, bitset_bindex *list,
   bitset_bindex count = 0;
   /* Is there enough room to avoid checking in each iteration? */
   if (num >= BITSET_WORD_BITS)
-    {
-      BITSET_FOR_EACH_BIT (pos, word)
-        list[count++] = bitno + pos;
-      *next = bitno + BITSET_WORD_BITS;
-      return count;
-    }
+    BITSET_FOR_EACH_BIT (pos, word)
+      list[count++] = bitno + pos;
   else
     BITSET_FOR_EACH_BIT (pos, word)
       {
@@ -81,6 +77,8 @@ abitset_small_list (bitset src, bitset_bindex *list,
             return count;
           }
       }
+  *next = bitno + BITSET_WORD_BITS;
+  return count;
 }