From 1c730aab868c5545528175b2f62ba5e91da85e08 Mon Sep 17 00:00:00 2001 From: gemu Date: Tue, 10 Sep 2024 14:48:38 +0200 Subject: [PATCH] fix trx pin error (#22119) --- tasmota/tasmota_xsns_sensor/xsns_53_sml.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index b32cce123..4984733c4 100755 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -3246,14 +3246,15 @@ dddef_exit: mmp->params = strtol(lp1, &lp1, 10); if (*lp1 != ',') goto next_line; lp1++; - mmp->prefix[SML_PREFIX_SIZE - 1] = 0; for (uint32_t cnt = 0; cnt < SML_PREFIX_SIZE; cnt++) { - if (*lp1 == SCRIPT_EOL || *lp1 == ',') { + if (!*lp1 || *lp1 == SCRIPT_EOL || *lp1 == ',') { mmp->prefix[cnt] = 0; break; } - mmp->prefix[cnt] = *lp1++; + mmp->prefix[cnt] = *lp1++; } + mmp->prefix[SML_PREFIX_SIZE - 1] = 0; + if (*lp1 == ',') { lp1++; // get TRX pin