From b23d19e4793259300856249c5649833bbf2f9fb7 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 9 Apr 2015 15:15:20 +1000 Subject: [PATCH] * database.c : imdb_write_rec() fix return value --- src/database.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/database.c b/src/database.c index a62d7ff..54d4431 100644 --- a/src/database.c +++ b/src/database.c @@ -162,7 +162,10 @@ int imdb_write_rec(imdb_t *db, imdb_rec_t *rec) DB_SEEK(db, rec->num * IMDB_REC_LEN); DB_WRITE(db, rec->data, IMDB_REC_LEN); - return bytes / IMDB_REC_LEN; + if (bytes != IMDB_REC_LEN) + return -1; + + return 1; } int imdb_read_blk(imdb_t *db, imdb_block_t *blk)