fix int to size_t

This commit is contained in:
Dennis Eichhorn 2022-11-04 15:09:18 -07:00
parent eb4aa2441c
commit 2805854bb2

View File

@ -24,10 +24,10 @@ namespace Utils {
{
const char* haystackT = haystack;
int i;
int match = 0;
int oldLength = strlen(needle);
int newLength = strlen(replace);
size_t i;
size_t match = 0;
size_t oldLength = strlen(needle);
size_t newLength = strlen(replace);
for (i = 0; haystack[i] != '\0'; ++i) {
if (strstr(&haystack[i], needle) == &haystack[i]) {
@ -42,7 +42,7 @@ namespace Utils {
return NULL;
}
int c = 0;
size_t c = 0;
while (*haystack && c < i + match * (newLength - oldLength)) {
if (strstr(haystack, needle) == haystack) {
strcpy(&result[c], replace);