From 6ac10d43b1bc3f8ae475abd448a6c62bdb12f158 Mon Sep 17 00:00:00 2001 From: Gabriel Fedel Date: Wed, 10 Mar 2021 09:42:56 +0100 Subject: [PATCH 1/2] Fix type comparision on msi.cpp This change fix the comparision of different signedess (int and long unsigned int). --- src/ioc/dbtemplate/msi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ioc/dbtemplate/msi.cpp b/src/ioc/dbtemplate/msi.cpp index 462869cb3..34afaabd5 100644 --- a/src/ioc/dbtemplate/msi.cpp +++ b/src/ioc/dbtemplate/msi.cpp @@ -300,7 +300,7 @@ static void makeSubstitutions(inputData * const inputPvt, char *pstart; char *pend; int cmdind=-1; - int i; + long unsigned int i; for (i = 0; i < NELEMENTS(cmdNames); i++) { if (strstr(command, cmdNames[i])) { From 0bc2a3e99930974199940b0d50e2c92401c980d3 Mon Sep 17 00:00:00 2001 From: Gabriel Fedel Date: Wed, 10 Mar 2021 14:37:14 +0100 Subject: [PATCH 2/2] Fix variable type and cast on msi.cpp This way the attribution of i to cmdind is a valid value. --- src/ioc/dbtemplate/msi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ioc/dbtemplate/msi.cpp b/src/ioc/dbtemplate/msi.cpp index 34afaabd5..6b899830f 100644 --- a/src/ioc/dbtemplate/msi.cpp +++ b/src/ioc/dbtemplate/msi.cpp @@ -300,11 +300,11 @@ static void makeSubstitutions(inputData * const inputPvt, char *pstart; char *pend; int cmdind=-1; - long unsigned int i; + size_t i; for (i = 0; i < NELEMENTS(cmdNames); i++) { if (strstr(command, cmdNames[i])) { - cmdind = i; + cmdind = (int)i; } } if (cmdind < 0) goto endcmd;