From 96aff63c712f2ec81ae28e1cf207d8fb4ccbe278 Mon Sep 17 00:00:00 2001 From: Adrian Scillato <35405447+ascillato@users.noreply.github.com> Date: Thu, 6 Sep 2018 14:26:26 -0300 Subject: [PATCH] Code Simplification for Substr --- sonoff/xdrv_11_knx.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonoff/xdrv_11_knx.ino b/sonoff/xdrv_11_knx.ino index ca5e22090..3897caac7 100644 --- a/sonoff/xdrv_11_knx.ino +++ b/sonoff/xdrv_11_knx.ino @@ -1156,7 +1156,7 @@ boolean KnxCommand() else if (CMND_KNX_PA == command_code) { if (XdrvMailbox.data_len) { if (strstr(XdrvMailbox.data, ".")) { // Process parameter entry - char sub_string[XdrvMailbox.data_len +1]; + char sub_string[XdrvMailbox.data_len]; int pa_area = atoi(subStr(sub_string, XdrvMailbox.data, ".", 1)); int pa_line = atoi(subStr(sub_string, XdrvMailbox.data, ".", 2)); @@ -1183,7 +1183,7 @@ boolean KnxCommand() else if ((CMND_KNX_GA == command_code) && (index > 0) && (index <= MAX_KNX_GA)) { if (XdrvMailbox.data_len) { if (strstr(XdrvMailbox.data, ",")) { // Process parameter entry - char sub_string[XdrvMailbox.data_len +1]; + char sub_string[XdrvMailbox.data_len]; int ga_option = atoi(subStr(sub_string, XdrvMailbox.data, ",", 1)); int ga_area = atoi(subStr(sub_string, XdrvMailbox.data, ",", 2)); @@ -1232,7 +1232,7 @@ boolean KnxCommand() else if ((CMND_KNX_CB == command_code) && (index > 0) && (index <= MAX_KNX_CB)) { if (XdrvMailbox.data_len) { if (strstr(XdrvMailbox.data, ",")) { // Process parameter entry - char sub_string[XdrvMailbox.data_len +1]; + char sub_string[XdrvMailbox.data_len]; int cb_option = atoi(subStr(sub_string, XdrvMailbox.data, ",", 1)); int cb_area = atoi(subStr(sub_string, XdrvMailbox.data, ",", 2));