summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck_ffs/setup.c')
-rw-r--r--sbin/fsck_ffs/setup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index 5bfae4d..db3fc3f 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -52,6 +52,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -243,7 +244,7 @@ setup(char *dev)
/*
* allocate and initialize the necessary maps
*/
- bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(short));
+ bmapsize = roundup(howmany(maxfsblock, CHAR_BIT), sizeof(short));
blockmap = calloc((unsigned)bmapsize, sizeof (char));
if (blockmap == NULL) {
printf("cannot alloc %u bytes for blockmap\n",
OpenPOWER on IntegriCloud