mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-27 01:58:41 +00:00
fix int to size_t
This commit is contained in:
parent
eb4aa2441c
commit
2805854bb2
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user