From 5577685d85e6b6170041432f09475e685bdd2904 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 3 Jan 2020 21:19:22 +0100 Subject: [PATCH] bug fix for processing version when no match found --- src/ems.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ems.cpp b/src/ems.cpp index 17de38bfc..837e6c8c9 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -1711,7 +1711,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { uint8_t i = 0; uint8_t found_index = 0; bool typeFound = false; - while ((i < _EMS_Devices_max) || (!typeFound)) { + while ((i < _EMS_Devices_max) && (!typeFound)) { if (EMS_Devices[i].product_id == product_id) { // we have a matching product id // now lets see if there is a matching device_id since product_id can be on multiple devices @@ -1721,6 +1721,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { if ((EMS_Devices_Types[j].device_type == device_type) && (EMS_Devices_Types[j].device_id == device_id)) { typeFound = true; found_index = i; + break; } } }