| 445 | } |
| 446 | |
| 447 | static inline char *bencode_dictionary_get_string(bencode_item_t *dict, const char *key, int *len) { |
| 448 | bencode_item_t *val; |
| 449 | val = bencode_dictionary_get(dict, key); |
| 450 | if (!val || val->type != BENCODE_STRING) |
| 451 | return NULL; |
| 452 | *len = val->iov[1].iov_len; |
| 453 | return val->iov[1].iov_base; |
| 454 | } |
| 455 | |
| 456 | static inline char *bencode_dictionary_get_str(bencode_item_t *dict, const char *key, str *str) { |
| 457 | str->s = bencode_dictionary_get_string(dict, key, &str->len); |
no test coverage detected