From 658b743414248c41e39ec8f375117931bc29b5e2 Mon Sep 17 00:00:00 2001 From: jasone Date: Thu, 12 Jan 2006 18:09:25 +0000 Subject: Fix a bitwise logic error in posix_memalign(). Reported by: glebius --- lib/libc/stdlib/malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/stdlib/malloc.c') diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 65374ea..d279db6 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1161,11 +1161,11 @@ posix_memalign(void **memptr, size_t alignment, size_t size) return (EINVAL); /* - * (size & alignment) is enough to assure the requested alignment, since + * (size | alignment) is enough to assure the requested alignment, since * the allocator always allocates power-of-two blocks. */ err = errno; /* Protect errno against changes in pubrealloc(). */ - result = pubrealloc(NULL, (size & alignment), " in posix_memalign()"); + result = pubrealloc(NULL, (size | alignment), " in posix_memalign()"); errno = err; if (result == NULL) -- cgit v1.1