mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-21 09:46:31 +00:00
Berry fix realline
(#23546)
This commit is contained in:
parent
b5d6e95164
commit
390927c190
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user