From f0f6f94374335838a5978e32900c34849c7e5af3 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 3 May 2021 12:49:41 +0200 Subject: [PATCH] Fix minimal compilation --- tasmota/xdrv_01_webserver.ino | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index cc22323a6..cc0ed52e4 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -420,6 +420,14 @@ static void WebGetArg(const char* arg, char* out, size_t max) // out[max-1] = '\0'; // Ensure terminating NUL } +String AddWebCommand(const char* command, const char* webarg, const char* dflt) { + char arg[100]; // Allow parameter with lenght up to 99 characters + WebGetArg(webarg, arg, sizeof(arg)); + char cmnd[120]; + snprintf_P(cmnd, sizeof(cmnd), PSTR(";%s %s"), command, (!strlen(arg)) ? dflt : (StrCaseStr_P(command, PSTR("Password")) && (strlen(arg) < 5)) ? "" : arg); + return String(cmnd); +} + static bool WifiIsInManagerMode(){ return (HTTP_MANAGER == Web.state || HTTP_MANAGER_RESET_ONLY == Web.state); } @@ -1975,14 +1983,6 @@ void HandleWifiConfiguration(void) { WSContentStop(); } -String AddWebCommand(const char* command, const char* webarg, const char* dflt) { - char arg[100]; // Allow parameter with lenght up to 99 characters - WebGetArg(webarg, arg, sizeof(arg)); - char cmnd[120]; - snprintf_P(cmnd, sizeof(cmnd), PSTR(";%s %s"), command, (!strlen(arg)) ? dflt : (StrCaseStr_P(command, PSTR("Password")) && (strlen(arg) < 5)) ? "" : arg); - return String(cmnd); -} - void WifiSaveSettings(void) { String cmnd = F(D_CMND_BACKLOG "0 "); cmnd += AddWebCommand(PSTR(D_CMND_HOSTNAME), PSTR("h"), PSTR("1"));