| 1472 | } |
| 1473 | |
| 1474 | void 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 | |
| 1488 | void substr_str(const char* str, int start_index, int end_index, char* substring) { |
| 1489 | int substring_length = end_index - start_index + 1; |
no outgoing calls
no test coverage detected