| 302 | } |
| 303 | |
| 304 | void String_InsertAt(cc_string* str, int offset, char c) { |
| 305 | int i; |
| 306 | |
| 307 | if (offset < 0 || offset > str->length) { |
| 308 | Process_Abort("Offset for InsertAt out of range"); |
| 309 | } |
| 310 | if (str->length == str->capacity) { |
| 311 | Process_Abort("Cannot insert character into full string"); |
| 312 | } |
| 313 | |
| 314 | for (i = str->length; i > offset; i--) { |
| 315 | str->buffer[i] = str->buffer[i - 1]; |
| 316 | } |
| 317 | str->buffer[offset] = c; |
| 318 | str->length++; |
| 319 | } |
| 320 | |
| 321 | void String_DeleteAt(cc_string* str, int offset) { |
| 322 | int i; |
no outgoing calls
no test coverage detected