MCPcopy Create free account
hub / github.com/cococry/leif / insert_str_str

Function insert_str_str

leif.c:1474–1486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1472}
1473
1474void insert_str_str(char* source, const char* insert, int32_t index) {
1475 int source_len = strlen(source);
1476 int insert_len = strlen(insert);
1477
1478 if (index < 0 || index > source_len) {
1479 LF_ERROR("Index for inserting out of bounds\n");
1480 return;
1481 }
1482
1483 memmove(source + index + insert_len, source + index, source_len - index + 1);
1484
1485 memcpy(source + index, insert, insert_len);
1486}
1487
1488void substr_str(const char* str, int start_index, int end_index, char* substring) {
1489 int substring_length = end_index - start_index + 1;

Callers 1

lf_input_insert_str_idxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected