| 1456 | } |
| 1457 | |
| 1458 | void insert_i_str(char *str, char ch, int32_t index) { |
| 1459 | int len = strlen(str); |
| 1460 | |
| 1461 | if (index < 0 || index > len) { |
| 1462 | LF_ERROR("Invalid string index for inserting.\n"); |
| 1463 | return; |
| 1464 | } |
| 1465 | |
| 1466 | for (int i = len; i > index; i--) { |
| 1467 | str[i] = str[i - 1]; |
| 1468 | } |
| 1469 | |
| 1470 | str[index] = ch; |
| 1471 | str[len + 1] = '\0'; |
| 1472 | } |
| 1473 | |
| 1474 | void insert_str_str(char* source, const char* insert, int32_t index) { |
| 1475 | int source_len = strlen(source); |
no outgoing calls
no test coverage detected