Avoid compiler warning about signedness mismatch

This warning kept appearing for me:

Script.cpp:350:35: warning: comparison of integer expressions of
different signedness: ‘int’ and
‘std::__cxx11::basic_string<char>::size_type’
{aka ‘long unsigned int’} [-Wsign-compare]

  350 |                 for (int i = 0; i < words[1].size(); i++)
      |                                 ~~^~~~~~~~~~~~~~~~~

So I just made it a size_t instead.
This commit is contained in:
Dav999
2026-05-14 03:23:25 +02:00
committed by Ethan Lee
parent 08aa7c9087
commit 85dae94d2e
+1 -1
View File
@@ -347,7 +347,7 @@ void scriptclass::run(void)
int current = 0;
// Crawl through the string
for (int i = 0; i < words[1].size(); i++)
for (size_t i = 0; i < words[1].size(); i++)
{
// If the current character is a number, add it to the current version part
if (words[1][i] >= '0' && words[1][i] <= '9')