From f659d18390837e589760b94506759ee5bca1d845 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 14 Aug 2018 15:39:36 +0200 Subject: [PATCH] bugfix rcommand.cpp (illegal commands chrash) --- src/rcommand.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/rcommand.cpp b/src/rcommand.cpp index 8899a805..0335877e 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -138,7 +138,7 @@ void set_loraadr(uint8_t val[]) { ESP_LOGI(TAG, "Remote command: set LoRa ADR mode to %s", val[0] ? "on" : "off"); cfg.adrmode = val[0] ? 1 : 0; -LMIC_setAdrMode(cfg.adrmode); + LMIC_setAdrMode(cfg.adrmode); #else ESP_LOGW(TAG, "Remote command: LoRa not implemented"); #endif // HAS_LORA @@ -267,10 +267,11 @@ void rcommand(uint8_t cmd[], uint8_t cmdlength) { TAG, "Remote command x%02X called with missing parameter(s), skipped", table[i].opcode); - break; // exit table lookup loop, command was found - } // command validation - } // command table lookup loop - + break; // command found -> exit table lookup loop + } // end of command validation + } // end of command table lookup loop + if (i < 0) // command not found -> exit parser + break; } // command parsing loop if (storeflag)