| 424 | } |
| 425 | |
| 426 | static bool runtime_wire_string_encode(uint8_t *out, size_t capacity, const char *value, |
| 427 | bool allow_empty) { |
| 428 | size_t length = 0; |
| 429 | if (!out || !runtime_bounded_length(value, capacity, &length) || |
| 430 | (!allow_empty && length == 0)) { |
| 431 | return false; |
| 432 | } |
| 433 | memset(out, 0, capacity); |
| 434 | memcpy(out, value, length); |
| 435 | return true; |
| 436 | } |
| 437 | |
| 438 | static bool runtime_wire_string_decode(const uint8_t *in, size_t capacity, char *out, |
| 439 | bool allow_empty) { |
no test coverage detected