| 48 | } |
| 49 | |
| 50 | cc_string String_UNSAFE_Substring(STRING_REF const cc_string* str, int offset, int length) { |
| 51 | if (offset < 0 || offset > str->length) { |
| 52 | Process_Abort("Offset for substring out of range"); |
| 53 | } |
| 54 | if (length < 0 || length > str->length) { |
| 55 | Process_Abort("Length for substring out of range"); |
| 56 | } |
| 57 | if (offset + length > str->length) { |
| 58 | Process_Abort("Result substring is out of range"); |
| 59 | } |
| 60 | return String_Init(str->buffer + offset, length, length); |
| 61 | } |
| 62 | |
| 63 | cc_string String_UNSAFE_SubstringAt(STRING_REF const cc_string* str, int offset) { |
| 64 | cc_string sub; |
no test coverage detected