Berry fix realline (#23546)

This commit is contained in:
s-hadinger 2025-06-14 10:37:04 +02:00 committed by GitHub
parent b5d6e95164
commit 390927c190
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- LVGL regression missing `lv.ANIM_OFF` and `lv.ANIM_ON`
- Berry fix `realline`
### Removed

View File

@ -316,10 +316,12 @@ char* be_fgets(void *hfile, void *buffer, int size)
if (hfile != nullptr && buffer != nullptr && size > 0) {
File * f_ptr = (File*) hfile;
int ret = f_ptr->readBytesUntil('\n', buf, size - 1);
// Serial.printf("be_fgets size=%d ret=%d\n", size, ret);
// Serial.printf("be_fgets size=%d ret=%d, tell=%i, fsize=%i\n", size, ret, f_ptr->position(), f_ptr->size());
if (ret >= 0) {
buf[ret] = 0; // add string terminator
if ((ret != 0) && (ret < size - 1)) {
if ((ret == 0) && (f_ptr->position() >= f_ptr->size())) {
return NULL;
} else if (ret < size - 1) {
buf[ret] = '\n';
buf[ret+1] = 0;
}
@ -327,7 +329,7 @@ char* be_fgets(void *hfile, void *buffer, int size)
}
}
#endif // USE_UFILESYS
return nullptr;
return NULL;
// return fgets(buffer, size, hfile);
}