From 06676482cca6fd0116bd38d4dad3b8cde6014e08 Mon Sep 17 00:00:00 2001 From: Kiril Zyapkov Date: Mon, 10 Aug 2015 16:17:16 +0300 Subject: [PATCH] strtod: allow endptr to be null --- cores/esp8266/libc_replacements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/esp8266/libc_replacements.c b/cores/esp8266/libc_replacements.c index 028bd1590..d04f78af9 100644 --- a/cores/esp8266/libc_replacements.c +++ b/cores/esp8266/libc_replacements.c @@ -229,7 +229,7 @@ double ICACHE_FLASH_ATTR strtod(const char* str, char** endptr) { if(*str == 0x00) { // only space in str? - *endptr = (char*) str; + if (endptr) *endptr = (char*) str; return result; } @@ -259,7 +259,7 @@ double ICACHE_FLASH_ATTR strtod(const char* str, char** endptr) { str++; } - *endptr = (char*) str; + if (endptr) *endptr = (char*) str; return result * factor; }