diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2012-09-13 10:45:42 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2012-09-13 10:45:42 +0000 |
commit | 364924d9ae381492f1769df7c8ad65c6a6fdf24b (patch) | |
tree | 2c86e56f4f15599225e5cb389c87e89a04bf2144 | |
parent | e07699e668829e643a614e8817e5ffa37924b0ba (diff) |
Fix precedence bug (& has lower precedence than !=).
Okay otto@.
Found by Michal Mazurek <akfaew at jasminek dot net>, thanks!
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 |
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; } |