| 510 | return out; |
| 511 | } |
| 512 | static inline int bencode_strcmp(bencode_item_t *a, const char *b) { |
| 513 | int len; |
| 514 | if (a->type != BENCODE_STRING) |
| 515 | return 2; |
| 516 | len = strlen(b); |
| 517 | if (a->iov[1].iov_len < len) |
| 518 | return -1; |
| 519 | if (a->iov[1].iov_len > len) |
| 520 | return 1; |
| 521 | return memcmp(a->iov[1].iov_base, b, len); |
| 522 | } |
| 523 | static inline int bencode_dictionary_get_strcmp(bencode_item_t *dict, const char *key, const char *str) { |
| 524 | bencode_item_t *i; |
| 525 | i = bencode_dictionary_get(dict, key); |
no outgoing calls
no test coverage detected