| 302 | } |
| 303 | |
| 304 | static bool runtime_bounded_length(const char *value, size_t capacity, size_t *length_out) { |
| 305 | if (!value || capacity == 0) { |
| 306 | return false; |
| 307 | } |
| 308 | for (size_t i = 0; i < capacity; i++) { |
| 309 | if (value[i] == '\0') { |
| 310 | if (length_out) { |
| 311 | *length_out = i; |
| 312 | } |
| 313 | return true; |
| 314 | } |
| 315 | } |
| 316 | return false; |
| 317 | } |
| 318 | |
| 319 | static bool runtime_wire_string_encode(uint8_t *out, size_t capacity, const char *value, |
| 320 | bool allow_empty) { |
no outgoing calls
no test coverage detected