diff options
author | Olivier Brunel <jjk@jjacky.com> | 2016-05-15 00:24:14 +0200 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-05-14 23:32:07 +0000 |
commit | 43dfdceef9f5eb75e8f3a50eb19ac9129f11b34e (patch) | |
tree | 3b3dd945515b735f7a2a1d9d5d6d389979b24e8c | |
parent | 00e0cad87182eebc8af16172c1dedb10761ffded (diff) | |
download | skalibs-43dfdceef9f5eb75e8f3a50eb19ac9129f11b34e.tar.xz |
bitarray_not: Fix skipping a byte
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
-rw-r--r-- | src/libstddjb/bitarray_not.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/bitarray_not.c b/src/libstddjb/bitarray_not.c index 4bd95ad..de37b9f 100644 --- a/src/libstddjb/bitarray_not.c +++ b/src/libstddjb/bitarray_not.c @@ -12,7 +12,7 @@ void bitarray_not (register unsigned char *s, register unsigned int a, register { register unsigned int i = (a>>3) + 1 ; s[a>>3] ^= ~((1 << (a & 7)) - 1) ; - for (; i < (b>>3) - 1 ; i++) s[i] = ~s[i] ; + for (; i < (b>>3) ; i++) s[i] = ~s[i] ; s[b>>3] ^= (1 << (b & 7)) - 1 ; } } |