From 650406db52aa8616c233f0185a40849a49542899 Mon Sep 17 00:00:00 2001 From: philmoz Date: Wed, 14 Dec 2022 20:18:34 +1100 Subject: [PATCH] fix(color): EM triggered when checking if modelID unique in certain instances (#2845) Cast comparison value to int to avoid signed / unsigned comparison error if (curr - warn_buf) > 48. --- radio/src/storage/modelslist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/storage/modelslist.cpp b/radio/src/storage/modelslist.cpp index e1c447881..0c7c74668 100644 --- a/radio/src/storage/modelslist.cpp +++ b/radio/src/storage/modelslist.cpp @@ -1521,7 +1521,7 @@ bool ModelsList::isModelIdUnique(uint8_t moduleIdx, char *warn_buf, // you cannot rely exactly on WARNING_LINE_LEN so using WARNING_LINE_LEN-2 // (-2 for the ",") - if ((warn_buf_len - 2 - (curr - warn_buf)) > LEN_MODEL_NAME) { + if ((int)(warn_buf_len - 2 - (curr - warn_buf)) > LEN_MODEL_NAME) { if (warn_buf[0] != 0) curr = strAppend(curr, ", "); if (modelName[0] == 0) { size_t len = min(strlen(modelFilename), LEN_MODEL_NAME);