4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-03-02 08:55:27 +08:00

malloc(0) is implementation defined.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1155 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2010-11-30 06:58:06 +00:00
parent b13215b7c7
commit e5eac973a8

View File

@ -43,7 +43,9 @@ int libc_mem(void)
p = malloc(0); p = malloc(0);
if (p == NULL) if (p == NULL)
merror("malloc (0) failed."); {
printf("malloc(0) returns NULL\n");
}
p = realloc(p, 0); p = realloc(p, 0);
if (p != NULL) if (p != NULL)