From 195958c9d6ce891291904ad1f6ec0b8ca4726c37 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Thu, 4 Mar 2021 22:10:12 +0100 Subject: [PATCH] OOM: avoid warn when calling *alloc(0) --- cores/esp8266/heap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/heap.cpp b/cores/esp8266/heap.cpp index 4821f9b772..b3fde2f6c0 100644 --- a/cores/esp8266/heap.cpp +++ b/cores/esp8266/heap.cpp @@ -194,8 +194,8 @@ void ICACHE_RAM_ATTR print_oom_size(size_t size) } } -#define OOM_CHECK__PRINT_OOM(p, s) if (!p) print_oom_size(s) -#define OOM_CHECK__PRINT_LOC(p, s, f, l) if (!p) print_loc(s, f, l) +#define OOM_CHECK__PRINT_OOM(p, s) if ((s) && !(p)) print_oom_size(s) +#define OOM_CHECK__PRINT_LOC(p, s, f, l) if ((s) && !(p)) print_loc(s, f, l) #else // ! DEBUG_ESP_OOM