diff --git a/CHANGELOG.md b/CHANGELOG.md index 7517f6d26cbf..88c52a8ba20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. ### Changed ### Fixed +- Berry `input()` returns empty string and does not crash ### Removed diff --git a/lib/libesp32/berry_tasmota/src/be_port.cpp b/lib/libesp32/berry_tasmota/src/be_port.cpp index 0c70bf61c55f..db40e153f0ea 100644 --- a/lib/libesp32/berry_tasmota/src/be_port.cpp +++ b/lib/libesp32/berry_tasmota/src/be_port.cpp @@ -216,7 +216,10 @@ extern "C" { BERRY_API char* be_readstring(char *buffer, size_t size) { - return be_fgets(stdin, buffer, (int)size); + if ((size > 0) && (buffer != NULL)) { + *buffer = 0; + } + return buffer; } /* use the standard library implementation file API. */