From 92d465fb56da1366a0b506cc012c83294376b9f0 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 16 Jan 2015 15:38:20 -0500 Subject: [PATCH] NewPtr(0) should return a non-null pointer. --- toolbox/mm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolbox/mm.cpp b/toolbox/mm.cpp index 2d47716..89c29d3 100644 --- a/toolbox/mm.cpp +++ b/toolbox/mm.cpp @@ -241,10 +241,10 @@ namespace MM // native pointers. mcptr = 0; - if (size == 0) return 0; + //if (size == 0) return 0; uint8_t *ptr = nullptr; - ptr = (uint8_t *)mplite_malloc(&pool, size); + ptr = (uint8_t *)mplite_malloc(&pool, size ? size : 1); if (!ptr) { return SetMemError(MacOS::memFullErr);