summaryrefslogtreecommitdiffstats
path: root/bin/ksh/alloc.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-07-14 13:36:46 +0000
committermillert <millert@openbsd.org>1999-07-14 13:36:46 +0000
commit2dee70884eb8130aeb605c0ea908656221da43f5 (patch)
tree62ddafa530c0fa1de2e228a4e5b22633d0805e60 /bin/ksh/alloc.c
parentLink vt.4 to pcvt.4 so one can do "man 4 vt" and have it do what you (diff)
downloadwireguard-openbsd-2dee70884eb8130aeb605c0ea908656221da43f5.tar.xz
wireguard-openbsd-2dee70884eb8130aeb605c0ea908656221da43f5.zip
pdksh-5.2.14
Diffstat (limited to 'bin/ksh/alloc.c')
-rw-r--r--bin/ksh/alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/alloc.c b/bin/ksh/alloc.c
index 3c7b15fbe34..d537206eaf5 100644
--- a/bin/ksh/alloc.c
+++ b/bin/ksh/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.3 1998/06/29 20:06:19 deraadt Exp $ */
+/* $OpenBSD: alloc.c,v 1.4 1999/07/14 13:37:23 millert Exp $ */
/*
* area-based allocation built on malloc/free
@@ -171,7 +171,7 @@ alloc(size, ap)
ACHECK(ap);
if (size <= 0)
aerror(ap, "allocate bad size");
- cells = (unsigned)(size - 1) / sizeof(Cell) + 1;
+ cells = (unsigned)(size + sizeof(Cell) - 1) / sizeof(Cell);
/* allocate at least this many cells */
acells = cells + NOBJECT_FIELDS;