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

Function String_UNSAFE_Substring

src/String.c:50–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50cc_string String_UNSAFE_Substring(STRING_REF const cc_string* str, int offset, int length) {
51 if (offset < 0 || offset > str->length) {
52 Process_Abort("Offset for substring out of range");
53 }
54 if (length < 0 || length > str->length) {
55 Process_Abort("Length for substring out of range");
56 }
57 if (offset + length > str->length) {
58 Process_Abort("Result substring is out of range");
59 }
60 return String_Init(str->buffer + offset, length, length);
61}
62
63cc_string String_UNSAFE_SubstringAt(STRING_REF const cc_string* str, int offset) {
64 cc_string sub;

Callers 15

Platform_NextArgFunction · 0.85
Platform_NextArgFunction · 0.85
HttpUrl_ParseFunction · 0.85
ExtractHostPortFunction · 0.85
InputWidget_UpdateCaretFunction · 0.85
InputWidget_PointerDownFunction · 0.85
ChatInputWidget_TabKeyFunction · 0.85
TextGroupWidget_GetUrlFunction · 0.85
TextAtlas_MakeFunction · 0.85
Soundboard_LoadFunction · 0.85

Calls 1

String_InitFunction · 0.85

Tested by

no test coverage detected