Browse Source

Fix precedence bug (& has lower precedence than !=).

Okay otto@.
Found by Michal Mazurek <akfaew at jasminek dot net>, thanks!
OPENBSD_5_3
pirofti 12 years ago
parent
commit
336a8ca4d4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/libc/stdlib/malloc.c

+ 2
- 2
src/lib/libc/stdlib/malloc.c View File

@ -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;
}


Loading…
Cancel
Save