Unverified Commit fd534184 authored by Luc Everse's avatar Luc Everse
Browse files

Fix get_next accessing off-by-one

parent 784fa478
......@@ -174,7 +174,7 @@ int ht_has_next(const struct Hanstable *table, size_t last_index) {
enum ht_Error ht_get_next(const struct Hanstable *table, size_t *last_index, const char **key, void *datap) {
void **data = (void **) datap;
while (*last_index <= table->cap_entries) {
while (*last_index < table->cap_entries) {
const char *ekey = table->entries[*last_index].key;
if (ekey != NULL && ekey != TOMBSTONE_KEY) {
if (key != NULL) *key = table->entries[*last_index].key;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment