mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-02-14 17:38:40 +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;
|
const char* haystackT = haystack;
|
||||||
|
|
||||||
int i;
|
size_t i;
|
||||||
int match = 0;
|
size_t match = 0;
|
||||||
int oldLength = strlen(needle);
|
size_t oldLength = strlen(needle);
|
||||||
int newLength = strlen(replace);
|
size_t newLength = strlen(replace);
|
||||||
|
|
||||||
for (i = 0; haystack[i] != '\0'; ++i) {
|
for (i = 0; haystack[i] != '\0'; ++i) {
|
||||||
if (strstr(&haystack[i], needle) == &haystack[i]) {
|
if (strstr(&haystack[i], needle) == &haystack[i]) {
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Utils {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int c = 0;
|
size_t c = 0;
|
||||||
while (*haystack && c < i + match * (newLength - oldLength)) {
|
while (*haystack && c < i + match * (newLength - oldLength)) {
|
||||||
if (strstr(haystack, needle) == haystack) {
|
if (strstr(haystack, needle) == haystack) {
|
||||||
strcpy(&result[c], replace);
|
strcpy(&result[c], replace);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user