From: Akim Demaille Date: Wed, 18 Nov 2020 06:27:52 +0000 (+0100) Subject: bitset: be sure to always return a value X-Git-Tag: v1.0~3493 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8e64e338f9bab57ce36debef80f4837508205701;p=gnulib.git bitset: be sure to always return a value * lib/bitset/array.c (abitset_small_list): Always update *next and return a value. --- diff --git a/ChangeLog b/ChangeLog index 52524da541..2bb8ae1239 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-11-19 Akim Demaille + + 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 vcs-to-changelog: Expect spaces in file names diff --git a/lib/bitset/array.c b/lib/bitset/array.c index 3f8bcca87d..0e90b6b1fe 100644 --- a/lib/bitset/array.c +++ b/lib/bitset/array.c @@ -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; }