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

Function String_DeleteAt

src/String.c:321–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void String_DeleteAt(cc_string* str, int offset) {
322 int i;
323
324 if (offset < 0 || offset >= str->length) {
325 Process_Abort("Offset for DeleteAt out of range");
326 }
327
328 for (i = offset; i < str->length - 1; i++) {
329 str->buffer[i] = str->buffer[i + 1];
330 }
331 str->buffer[str->length - 1] = '\0';
332 str->length--;
333}
334
335void String_UNSAFE_TrimStart(cc_string* str) {
336 int i;

Callers 9

LInput_BackspaceFunction · 0.85
LInput_DeleteFunction · 0.85
InputWidget_DeleteCharFunction · 0.85
InputWidget_BackspaceKeyFunction · 0.85
InputWidget_DeleteKeyFunction · 0.85
ChatInputWidget_TabKeyFunction · 0.85
Http_AddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected