]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: Added assert.
authorTimo Sirainen <tss@iki.fi>
Tue, 22 Dec 2009 23:12:19 +0000 (18:12 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 22 Dec 2009 23:12:19 +0000 (18:12 -0500)
--HG--
branch : HEAD

src/lib-storage/index/dbox-common/dbox-file.c

index 05e338b07c57e6cb1f5448de1738f66399071838..b9289f343a3b548ad58f5fb2824c48676ac0fb08 100644 (file)
@@ -358,6 +358,8 @@ int dbox_file_seek_next(struct dbox_file *file, uoff_t *offset_r, bool *last_r)
        uoff_t offset, size;
        int ret;
 
+       i_assert(file->input != NULL);
+
        if (file->cur_offset == (uoff_t)-1) {
                /* first mail. we may not have read the file at all yet,
                   so set the offset afterwards. */
@@ -372,7 +374,7 @@ int dbox_file_seek_next(struct dbox_file *file, uoff_t *offset_r, bool *last_r)
        }
        *offset_r = offset;
 
-       if (file->input != NULL && i_stream_is_eof(file->input)) {
+       if (i_stream_is_eof(file->input)) {
                *last_r = TRUE;
                return 0;
        }