| 458 | } |
| 459 | |
| 460 | static void __bencode_hash_insert(bencode_item_t *key, struct __bencode_hash *hash) { |
| 461 | unsigned int bucket, i; |
| 462 | |
| 463 | i = bucket = __bencode_hash_str(key); |
| 464 | |
| 465 | while (1) { |
| 466 | if (!hash->buckets[i]) { |
| 467 | hash->buckets[i] = key; |
| 468 | break; |
| 469 | } |
| 470 | i++; |
| 471 | if (i >= BENCODE_HASH_BUCKETS) |
| 472 | i = 0; |
| 473 | if (i == bucket) |
| 474 | break; |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | static bencode_item_t *__bencode_decode_dictionary(bencode_buffer_t *buf, const char *s, const char *end) { |
| 479 | bencode_item_t *ret, *key, *value; |
no test coverage detected