summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2006-01-12 18:09:25 +0000
committerjasone <jasone@FreeBSD.org>2006-01-12 18:09:25 +0000
commit658b743414248c41e39ec8f375117931bc29b5e2 (patch)
treeee0b3fa63999f8210747ca1cd47b23d58fc5be10 /lib
parent2d1aacc0567235bb47bd81c567edc46b5d42aaa8 (diff)
downloadFreeBSD-src-658b743414248c41e39ec8f375117931bc29b5e2.zip
FreeBSD-src-658b743414248c41e39ec8f375117931bc29b5e2.tar.gz
Fix a bitwise logic error in posix_memalign().
Reported by: glebius
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/malloc.c4
1 files changed, 2 insertions, 2 deletions
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)
OpenPOWER on IntegriCloud