| 409 | } |
| 410 | |
| 411 | static bool runtime_bounded_length(const char *value, size_t capacity, size_t *length_out) { |
| 412 | if (!value || capacity == 0) { |
| 413 | return false; |
| 414 | } |
| 415 | for (size_t i = 0; i < capacity; i++) { |
| 416 | if (value[i] == '\0') { |
| 417 | if (length_out) { |
| 418 | *length_out = i; |
| 419 | } |
| 420 | return true; |
| 421 | } |
| 422 | } |
| 423 | return false; |
| 424 | } |
| 425 | |
| 426 | static bool runtime_wire_string_encode(uint8_t *out, size_t capacity, const char *value, |
| 427 | bool allow_empty) { |
no outgoing calls
no test coverage detected