about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-05-14 21:41:26 +0000
committerUlrich Drepper <drepper@redhat.com>2002-05-14 21:41:26 +0000
commit61ea97abdf8fcb7fb97d494b9f15b76502dbe407 (patch)
tree88df77d67f29d16ce79ad3c63157889941e31415 /malloc
parent3f7c7ac41a2ae41da9a1e84375a37bc05d65f95a (diff)
downloadglibc-61ea97abdf8fcb7fb97d494b9f15b76502dbe407.tar.gz
glibc-61ea97abdf8fcb7fb97d494b9f15b76502dbe407.tar.xz
glibc-61ea97abdf8fcb7fb97d494b9f15b76502dbe407.zip
(__posix_memalign): Correct check for size of alignment value.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 8279ddaf22..db65535e49 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+   Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
    and Doug Lea <dl@cs.oswego.edu>, 1996.
@@ -4899,9 +4899,9 @@ __posix_memalign (void **memptr, size_t alignment, size_t size)
 {
   void *mem;
 
-  /* Test whether the SIZE argument is valid.  It must be a power of
-     two multiple of sizeof (void *).  */
-  if (size % sizeof (void *) != 0 || (size & (size - 1)) != 0)
+  /* Test whether the ALIGNMENT argument is valid.  It must be a power
+     of two multiple of sizeof (void *).  */
+  if (alignment % sizeof (void *) != 0 || (alignment & (alignment - 1)) != 0)
     return EINVAL;
 
   mem = __libc_memalign (alignment, size);