From b89ceeeaf2bf82f63b501ada45808da9dcb252cb Mon Sep 17 00:00:00 2001 From: agessaman Date: Fri, 7 Nov 2025 13:39:38 -0800 Subject: [PATCH] Fix timezone command handling in CommonCLI by adjusting string comparison lengths for accurate parsing. Updated offsets to ensure correct handling of timezone and timezone.offset commands. --- src/helpers/CommonCLI.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers/CommonCLI.cpp b/src/helpers/CommonCLI.cpp index 3080da82..7f0e70b9 100644 --- a/src/helpers/CommonCLI.cpp +++ b/src/helpers/CommonCLI.cpp @@ -751,12 +751,12 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch StrHelper::strncpy(_prefs->wifi_password, &config[9], sizeof(_prefs->wifi_password)); savePrefs(); strcpy(reply, "OK"); - } else if (memcmp(config, "timezone ", 10) == 0) { - StrHelper::strncpy(_prefs->timezone_string, &config[10], sizeof(_prefs->timezone_string)); + } else if (memcmp(config, "timezone ", 9) == 0) { + StrHelper::strncpy(_prefs->timezone_string, &config[9], sizeof(_prefs->timezone_string)); savePrefs(); strcpy(reply, "OK"); - } else if (memcmp(config, "timezone.offset ", 17) == 0) { - int8_t offset = _atoi(&config[17]); + } else if (memcmp(config, "timezone.offset ", 16) == 0) { + int8_t offset = _atoi(&config[16]); if (offset >= -12 && offset <= 14) { _prefs->timezone_offset = offset; savePrefs();