| 128 | } |
| 129 | |
| 130 | bool tir_cstring(tir_context *c, const char *s, tir_bytes *out) { |
| 131 | if (!s) |
| 132 | return tir_fail(c, CBM_TEST_RESULT_INVALID); |
| 133 | size_t length = 0; |
| 134 | for (;;) { |
| 135 | if (!tir_input_bytes(c, 1) || !tir_step(c, 1, 0)) |
| 136 | return false; |
| 137 | if (!s[length]) |
| 138 | break; |
| 139 | if (length == SIZE_MAX - 1) |
| 140 | return tir_fail(c, CBM_TEST_RESULT_LIMIT); |
| 141 | length++; |
| 142 | } |
| 143 | *out = (tir_bytes){(const unsigned char *)s, length}; |
| 144 | return true; |
| 145 | } |
| 146 | |
| 147 | static bool tir_utf8_tail(tir_context *c, tir_bytes b, size_t *at, unsigned count, uint32_t value, |
| 148 | uint32_t minimum) { |
no test coverage detected