MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / String_IndexOfConst

Function String_IndexOfConst

src/String.c:353–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353int String_IndexOfConst(const cc_string* str, const char* sub) {
354 int i, j;
355
356 for (i = 0; i < str->length; i++) {
357 for (j = 0; sub[j] && (i + j) < str->length; j++) {
358
359 if (str->buffer[i + j] != sub[j]) break;
360 }
361 if (sub[j] == '\0') return i;
362 }
363 return -1;
364}
365
366int String_CaselessContains(const cc_string* str, const cc_string* sub) {
367 char strCur, subCur;

Callers 6

HttpUrl_ParseFunction · 0.85
HttpUrl_ResolveRedirectFunction · 0.85
Utils_IsUrlPrefixFunction · 0.85
WoM_CheckMotdFunction · 0.85
Platform_InitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected