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