Handle empty prevalue.ini gracefully (#3162)

Fixes #2149.
This commit is contained in:
Sebastian Lövdahl
2024-08-09 02:01:58 +03:00
committed by GitHub
parent f99dc8fdfc
commit 17fe87b349

View File

@@ -161,6 +161,9 @@ bool ClassFlowPostProcessing::LoadPreValue(void) {
return false;
}
// Makes sure that an empty file is treated as such.
zw[0] = '\0';
fgets(zw, 1024, pFile);
ESP_LOGD(TAG, "Read line Prevalue.ini: %s", zw);
zwtime = trim(std::string(zw));