Fix a bitwise logic error in posix_memalign().

Reported by:	glebius
This commit is contained in:
Jason Evans 2006-01-12 18:09:25 +00:00
parent 7a62fb4692
commit 352219015d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154263

View file

@ -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)