From 8cf3b43efb91aa17a50492aa0efe96c416063098 Mon Sep 17 00:00:00 2001 From: tablatronix <807787+tablatronix@users.noreply.github.com> Date: Wed, 15 Mar 2023 21:24:44 -0500 Subject: [PATCH] Remove hacky scope check, param length 0 --- WiFiManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index ea7f098..d280285 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -31,7 +31,7 @@ WiFiManagerParameter::WiFiManagerParameter() { WiFiManagerParameter::WiFiManagerParameter(const char *custom) { _id = NULL; _label = NULL; - _length = 1; + _length = 0; _value = nullptr; _labelPlacement = WFM_LABEL_DEFAULT; _customHTML = custom; @@ -58,7 +58,7 @@ void WiFiManagerParameter::init(const char *id, const char *label, const char *d _label = label; _labelPlacement = labelPlacement; _customHTML = custom; - _length = 1; + _length = 0; _value = nullptr; setValue(defaultValue,length); } @@ -1734,7 +1734,7 @@ String WiFiManager::getParamOut(){ for (int i = 0; i < _paramsCount; i++) { //Serial.println((String)_params[i]->_length); - if (_params[i] == NULL || _params[i]->_length == 0 || _params[i]->_length > 99999) { + if (_params[i] == NULL || _params[i]->_length > 99999) { // try to detect param scope issues, doesnt always catch but works ok #ifdef WM_DEBUG_LEVEL DEBUG_WM(DEBUG_ERROR,F("[ERROR] WiFiManagerParameter is out of scope"));