summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2012-09-13 10:45:41 +0000
committerpirofti <pirofti@openbsd.org>2012-09-13 10:45:41 +0000
commit9a52edda8f0a84eceec2c4a8e5afb37c2d2dfdbf (patch)
tree51c29b9ac8d279ac7e07814024ee42238d77f4d1 /lib/libc
parentUpdate to tzdata2012f from ftp.iana.org (diff)
downloadwireguard-openbsd-9a52edda8f0a84eceec2c4a8e5afb37c2d2dfdbf.tar.xz
wireguard-openbsd-9a52edda8f0a84eceec2c4a8e5afb37c2d2dfdbf.zip
Fix precedence bug (& has lower precedence than !=).
Okay otto@. Found by Michal Mazurek <akfaew at jasminek dot net>, thanks!
Diffstat (limited to 'lib/libc')
-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 ff71da8f6ef..c69ec8316a6 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.146 2012/07/09 08:39:24 deraadt Exp $ */
+/* $OpenBSD: malloc.c,v 1.147 2012/09/13 10:45:41 pirofti Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
*
@@ -1429,7 +1429,7 @@ mapalign(struct dir_info *d, size_t alignment, size_t sz, int zero_fill)
{
void *p, *q;
- if (alignment < MALLOC_PAGESIZE || alignment & (alignment - 1) != 0) {
+ if (alignment < MALLOC_PAGESIZE || ((alignment - 1) & alignment) != 0) {
wrterror("mapalign bad alignment", NULL);
return MAP_FAILED;
}