summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-22 02:06:35 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-22 02:06:35 +0000
commita3e9840d06d9cde5c91899ab85b7f7f383e3081f (patch)
treec0938c7ec75727c44e598a85e8b7f5f8ab620a99 /test
parente6a337774935283611448c70548edc871ac06772 (diff)
update malloc(0) check to handle expected behavior based upon config options
Diffstat (limited to 'test')
-rw-r--r--test/malloc/tst-mcheck.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/malloc/tst-mcheck.c b/test/malloc/tst-mcheck.c
index 16784912a..af72c042b 100644
--- a/test/malloc/tst-mcheck.c
+++ b/test/malloc/tst-mcheck.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <features.h>
static int errors = 0;
@@ -53,7 +54,11 @@ main (void)
merror ("realloc (p, 0) failed.");
p = malloc (0);
+#if !defined(__UCLIBC__) || defined(__MALLOC_GLIBC_COMPAT__)
if (p == NULL)
+#else
+ if (p != NULL)
+#endif
merror ("malloc (0) failed.");
p = realloc (p, 0);