diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b3d112d..1e01ae304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ All notable changes to this project will be documented in this file. - Berry avoid json parsing for unmatched commands (#23494) - Berry integer and real parser to handle overflows (#23495) - Berry potential pointer underflow with `string.endswith` (#23496) +- Autoconf failing when last line has no trailing LF ### Removed diff --git a/lib/libesp32/berry_tasmota/src/be_port.cpp b/lib/libesp32/berry_tasmota/src/be_port.cpp index c07200b2d..300c6de00 100644 --- a/lib/libesp32/berry_tasmota/src/be_port.cpp +++ b/lib/libesp32/berry_tasmota/src/be_port.cpp @@ -319,7 +319,7 @@ char* be_fgets(void *hfile, void *buffer, int size) // Serial.printf("be_fgets size=%d ret=%d\n", size, ret); if (ret >= 0) { buf[ret] = 0; // add string terminator - if (ret < size - 1) { + if ((ret != 0) && (ret < size - 1)) { buf[ret] = '\n'; buf[ret+1] = 0; }