From 43dfdceef9f5eb75e8f3a50eb19ac9129f11b34e Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Sun, 15 May 2016 00:24:14 +0200 Subject: bitarray_not: Fix skipping a byte Signed-off-by: Olivier Brunel --- src/libstddjb/bitarray_not.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ; } } -- cgit v1.2.3