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.
This commit is contained in:
philmoz
2022-12-14 19:18:34 +10:00
committed by GitHub
parent c505f9eb01
commit 650406db52
+1 -1
View File
@@ -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<size_t>(strlen(modelFilename), LEN_MODEL_NAME);