diff --git a/src/database.c b/src/database.c index 00b8d8e..fcc3579 100644 --- a/src/database.c +++ b/src/database.c @@ -240,7 +240,7 @@ simdb_record_used(simdb_t *db, int num) { assert(db != NULL); - if (num > db->records) + if (num <= 0 || num > db->records) return false; if (simdb_read(db, num, 1, &rec) < 1)