| 313 | } |
| 314 | |
| 315 | void json_add_hex(struct json_stream *js, const char *fieldname, |
| 316 | const void *data, size_t len) |
| 317 | { |
| 318 | /* Size without NUL term */ |
| 319 | size_t hexlen = hex_str_size(len); |
| 320 | char str[hexlen]; |
| 321 | |
| 322 | if (!hex_encode(data, len, str, hexlen)) |
| 323 | abort(); |
| 324 | |
| 325 | json_add_string(js, fieldname, str); |
| 326 | } |
| 327 | |
| 328 | void json_add_hex_talarr(struct json_stream *result, |
| 329 | const char *fieldname, |
no test coverage detected