From 364924d9ae381492f1769df7c8ad65c6a6fdf24b Mon Sep 17 00:00:00 2001 From: Paul Irofti Date: Thu, 13 Sep 2012 10:45:42 +0000 Subject: Fix precedence bug (& has lower precedence than !=). Okay otto@. Found by Michal Mazurek , thanks! --- lib/libc/stdlib/malloc.c | 4 ++-- 1 file 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 * @@ -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; } -- cgit v1.2.3