diff --git a/cores/esp8266/heap.cpp b/cores/esp8266/heap.cpp index 2001579ef..3f549716f 100644 --- a/cores/esp8266/heap.cpp +++ b/cores/esp8266/heap.cpp @@ -164,7 +164,7 @@ void ICACHE_RAM_ATTR print_loc(size_t size, const char* file, int line) if (inISR && (uint32_t)file >= 0x40200000) { DEBUG_HEAP_PRINTF("File: %p", file); } else if (!inISR && (uint32_t)file >= 0x40200000) { - char buf[ets_strlen(file)] __attribute__ ((aligned(4))); + char buf[ets_strlen(file) + 1] __attribute__((aligned(4))); ets_strcpy(buf, file); DEBUG_HEAP_PRINTF(buf); } else { diff --git a/cores/esp8266/umm_malloc/umm_local.c b/cores/esp8266/umm_malloc/umm_local.c index 8f83f4b4a..392ef13c8 100644 --- a/cores/esp8266/umm_malloc/umm_local.c +++ b/cores/esp8266/umm_malloc/umm_local.c @@ -206,7 +206,7 @@ int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) { the PROGMEM address must be word (4 bytes) aligned. The destination address for ets_memcpy must also be word-aligned. */ - char ram_buf[ets_strlen(fmt)] __attribute__ ((aligned(4))); + char ram_buf[ets_strlen(fmt) + 1] __attribute__((aligned(4))); ets_strcpy(ram_buf, fmt); va_list argPtr; va_start(argPtr, fmt);