From c153fc0d8bf2f2e57b75bfde81539305f6fa0c50 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 6 Oct 2021 01:03:11 -0400 Subject: ota.h fix: use strlen instead of sizeof --- ota.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ota.h b/ota.h index 28fb37b..2bcadfe 100644 --- a/ota.h +++ b/ota.h @@ -20,6 +20,7 @@ #ifndef ota_h #define ota_h // needed include files +#include #include #include #include @@ -32,9 +33,8 @@ // Establish WiFi connection // ================================================================== void setupWifi(char hostname[]) { - int i = 0; WiFi.mode(WIFI_STA); - if (sizeof(hostname) > 0) { + if (strlen(hostname) > 0) { WiFi.hostname(hostname); } if (Serial) {Serial.println("Connecting ");} @@ -60,7 +60,7 @@ void setupOTA(char hostname[]) { // ArduinoOTA.setPort(8266); // Hostname defaults to esp8266-[ChipID] - if (sizeof(hostname) > 0) { + if (strlen(hostname) > 0) { ArduinoOTA.setHostname(hostname); } -- cgit v1.2.3