Explorar o código

Handle empty prevalue.ini gracefully (#3162)

Fixes #2149.
Sebastian Lövdahl hai 1 ano
pai
achega
17fe87b349

+ 3 - 0
code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

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