diff options
Diffstat (limited to 'lib/ext2fs/dblist.c')
-rw-r--r-- | lib/ext2fs/dblist.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c index 4cb7ca18..3f6ea50d 100644 --- a/lib/ext2fs/dblist.c +++ b/lib/ext2fs/dblist.c @@ -393,10 +393,11 @@ int ext2fs_dblist_count(ext2_dblist dblist) errcode_t ext2fs_dblist_get_last(ext2_dblist dblist, struct ext2_db_entry **entry) { - EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST); static struct ext2_db_entry ret_entry; struct ext2_db_entry2 *last; + EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST); + if (dblist->count == 0) return EXT2_ET_DBLIST_EMPTY; |