| 299 | } |
| 300 | |
| 301 | void json_add_hex(struct json_stream *js, const char *fieldname, |
| 302 | const void *data, size_t len) |
| 303 | { |
| 304 | /* Size without NUL term */ |
| 305 | size_t hexlen = hex_str_size(len); |
| 306 | char str[hexlen]; |
| 307 | |
| 308 | if (!hex_encode(data, len, str, hexlen)) |
| 309 | abort(); |
| 310 | |
| 311 | json_add_string(js, fieldname, str); |
| 312 | } |
| 313 | |
| 314 | void json_add_hex_talarr(struct json_stream *result, |
| 315 | const char *fieldname, |
no test coverage detected