| 321 | } |
| 322 | |
| 323 | static bool runtime_wire_string_encode(uint8_t *out, size_t capacity, const char *value, |
| 324 | bool allow_empty) { |
| 325 | size_t length = 0; |
| 326 | if (!out || !runtime_bounded_length(value, capacity, &length) || |
| 327 | (!allow_empty && length == 0)) { |
| 328 | return false; |
| 329 | } |
| 330 | memset(out, 0, capacity); |
| 331 | memcpy(out, value, length); |
| 332 | return true; |
| 333 | } |
| 334 | |
| 335 | static bool runtime_wire_string_decode(const uint8_t *in, size_t capacity, char *out, |
| 336 | bool allow_empty) { |
no test coverage detected