diff --git a/include/ck_bitmap.h b/include/ck_bitmap.h index 56536c0..96ab630 100644 --- a/include/ck_bitmap.h +++ b/include/ck_bitmap.h @@ -88,7 +88,7 @@ ck_bitmap_init(struct ck_bitmap *bitmap, bitmap->map = buffer; bitmap->length = length; bitmap->n_buckets = ck_bitmap_size(length) / sizeof(CK_BITMAP_TYPE); - memset(bitmap->map, -(int)set, length); + memset(bitmap->map, -(int)set, ck_bitmap_size(length)); return; } diff --git a/regressions/ck_bitmap/validate/serial.c b/regressions/ck_bitmap/validate/serial.c index 409a853..3b7ad26 100644 --- a/regressions/ck_bitmap/validate/serial.c +++ b/regressions/ck_bitmap/validate/serial.c @@ -98,5 +98,7 @@ main(int argc, char *argv[]) ck_bitmap_init(&bits, buffer, length, true); test(&bits, true); + ck_bitmap_test(&bits, length - 1); + return 0; }