mutt_str_startswith - mbox/mbox.c
authorPietro Cerutti <gahr@gahr.ch>
Mon, 12 Nov 2018 11:34:25 +0000 (11:34 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 14 Nov 2018 15:10:31 +0000 (15:10 +0000)
mbox/mbox.c

index c890ad8c07ef04ef7c2ebbf35a3c53c884108f5c..70e661aba25eba48b2b012651106d0dd1b441657 100644 (file)
@@ -1354,7 +1354,7 @@ static int mbox_mbox_sync(struct Context *ctx, int *index_hint)
   if (fseeko(adata->fp, offset, SEEK_SET) != 0 || /* seek the append location */
       /* do a sanity check to make sure the mailbox looks ok */
       !fgets(buf, sizeof(buf), adata->fp) ||
-      (ctx->mailbox->magic == MUTT_MBOX && mutt_str_strncmp("From ", buf, 5) != 0) ||
+      (ctx->mailbox->magic == MUTT_MBOX && !mutt_str_startswith(buf, "From ", CASE_MATCH)) ||
       (ctx->mailbox->magic == MUTT_MMDF && (mutt_str_strcmp(MMDF_SEP, buf) != 0)))
   {
     mutt_debug(1, "message not in expected position.\n");