From 3da28e351287acd28dc7f83c56501d8ddb6062d4 Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Wed, 15 Apr 2020 18:53:05 +0900 Subject: [PATCH] Fixed refer to uninitialized --- src/AutoConnectPage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AutoConnectPage.cpp b/src/AutoConnectPage.cpp index 682aa02..725e372 100644 --- a/src/AutoConnectPage.cpp +++ b/src/AutoConnectPage.cpp @@ -1278,7 +1278,7 @@ String AutoConnect::_token_CONFIG_STAIP(PageArgument& args) { char* liBuf = liCont; for (uint8_t i = 0; i < 5; i++) { - IPAddress* ip; + IPAddress* ip = nullptr; if (i == 0) ip = &_apConfig.staip; else if (i == 1) @@ -1289,7 +1289,7 @@ String AutoConnect::_token_CONFIG_STAIP(PageArgument& args) { ip = &_apConfig.dns1; else if (i == 4) ip = &_apConfig.dns2; - String ipStr = *ip ? ip->toString() : String(F("0.0.0.0")); + String ipStr = ip != nullptr ? ip->toString() : String(F("0.0.0.0")); snprintf_P(liBuf, sizeof(liCont) - (liBuf - liCont), (PGM_P)_configIPList, reps[i].lid, reps[i].lbl, reps[i].lid, reps[i].lid, ipStr.c_str()); liBuf += strlen(liBuf); }