From 9d4541d703090510830019e4a9746209a692bb83 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 19 Apr 2012 17:01:51 -0400 Subject: [PATCH] ck_bitmap: Fix ck_bitmap_init. Refs #85 --- include/ck_bitmap.h | 2 +- regressions/ck_bitmap/validate/serial.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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; }