From e5eac973a87ec17a05d81e94229bca4997dfcc06 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Tue, 30 Nov 2010 06:58:06 +0000 Subject: [PATCH] malloc(0) is implementation defined. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1155 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- examples/libc/memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/libc/memory.c b/examples/libc/memory.c index 0a0bfecd80..81b566f646 100644 --- a/examples/libc/memory.c +++ b/examples/libc/memory.c @@ -43,7 +43,9 @@ int libc_mem(void) p = malloc(0); if (p == NULL) - merror("malloc (0) failed."); + { + printf("malloc(0) returns NULL\n"); + } p = realloc(p, 0); if (p != NULL)