aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/db/hash/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/db/hash/hash.c')
-rw-r--r--lib/libc/db/hash/hash.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index f7b14276000c6..c7dc4e78b5958 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -160,8 +160,7 @@ __hash_open(const char *file, int flags, int mode,
* maximum bucket number, so the number of buckets is
* max_bucket + 1.
*/
- nsegs = (hashp->MAX_BUCKET + 1 + hashp->SGSIZE - 1) /
- hashp->SGSIZE;
+ nsegs = howmany(hashp->MAX_BUCKET + 1, hashp->SGSIZE);
if (alloc_segs(hashp, nsegs))
/*
* If alloc_segs fails, table will have been destroyed