summaryrefslogtreecommitdiff
path: root/test/malloc/tst-malloc.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-22 02:04:31 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-22 02:04:31 +0000
commite6a337774935283611448c70548edc871ac06772 (patch)
treeca4073230a6377a3bea58a4c77b59042dffb38c8 /test/malloc/tst-malloc.c
parent31ff6e059f6473891d90d2ebe7548fe77b85717a (diff)
update malloc(0) check to handle expected behavior based upon config options
Diffstat (limited to 'test/malloc/tst-malloc.c')
-rw-r--r--test/malloc/tst-malloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/malloc/tst-malloc.c b/test/malloc/tst-malloc.c
index d555ae46e..468e1d4ba 100644
--- a/test/malloc/tst-malloc.c
+++ b/test/malloc/tst-malloc.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <malloc.h>
#include <stdio.h>
+#include <features.h>
static int errors = 0;
@@ -57,7 +58,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);