From 2373cd9b47117aa2eac944cc36f5e88afd7acbef Mon Sep 17 00:00:00 2001 From: simokawa Date: Wed, 13 Jan 1999 10:37:22 +0000 Subject: Allocate aligned memory according to sizeof(char *). Approved by: jkh Obtained from: NetBSD --- usr.bin/mail/strings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/mail/strings.c') diff --git a/usr.bin/mail/strings.c b/usr.bin/mail/strings.c index f27b959..2f24f31 100644 --- a/usr.bin/mail/strings.c +++ b/usr.bin/mail/strings.c @@ -64,8 +64,8 @@ salloc(size) int index; s = size; - s += 3; - s &= ~03; + s += (sizeof (char *) - 1); + s &= ~(sizeof (char *) - 1); index = 0; for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) { if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s) -- cgit v1.1