summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Kolomiiets <yarikos@gmail.com>2017-02-27 17:34:01 +0200
committerYaroslav Kolomiiets <yarikos@gmail.com>2017-02-27 17:34:01 +0200
commit2284680be58c8b783d8257d1ca36fc214b574d1e (patch)
treed9447e8187ed9d73da6a060fdc1dfdb7ad830e5c
parent989a7447a8c64d6e9041877a1bbefb4036427d5f (diff)
limbo/lex.c: allow malloc(0) to return nil as some implementations do
-rw-r--r--limbo/lex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/limbo/lex.c b/limbo/lex.c
index d75e28f2..747cfaaf 100644
--- a/limbo/lex.c
+++ b/limbo/lex.c
@@ -1435,7 +1435,7 @@ allocmem(ulong n)
void *p;
p = malloc(n);
- if(p == nil)
+ if(p == nil && n != 0)
fatal("out of memory");
return p;
}