Autoconf failing when last line has no trailing LF (#23537)

This commit is contained in:
s-hadinger 2025-06-11 23:10:20 +02:00 committed by GitHub
parent 004f1ec36a
commit ea99e4724f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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;
}