Skip to content

Commit 47b7bcb

Browse files
committed
strtod: allow endptr to be null
1 parent f73457d commit 47b7bcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ double ICACHE_FLASH_ATTR strtod(const char* str, char** endptr) {
229229

230230
if(*str == 0x00) {
231231
// only space in str?
232-
*endptr = (char*) str;
232+
if (endptr) *endptr = (char*) str;
233233
return result;
234234
}
235235

@@ -259,7 +259,7 @@ double ICACHE_FLASH_ATTR strtod(const char* str, char** endptr) {
259259

260260
str++;
261261
}
262-
*endptr = (char*) str;
262+
if (endptr) *endptr = (char*) str;
263263
return result * factor;
264264
}
265265

0 commit comments

Comments
 (0)