summaryrefslogtreecommitdiffstats
path: root/imap
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-06-19 08:38:57 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-06-19 08:38:57 +0000
commit42078a478a0d46599e048018ceb50dae25812d22 (patch)
treebc07adf02f2632f5341de1549b54f00bc2b74c8f /imap
parent391cdcad6ca542b280ec5435f7a4b4bbd8cb127e (diff)
IMAP error checking for bug #662. From Brendan Cully.
Diffstat (limited to 'imap')
-rw-r--r--imap/imap.c7
-rw-r--r--imap/message.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/imap/imap.c b/imap/imap.c
index 33aa7495..d9e5a40e 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -650,7 +650,12 @@ int imap_open_mailbox (CONTEXT* ctx)
ctx->hdrs = safe_malloc (count * sizeof (HEADER *));
ctx->v2r = safe_malloc (count * sizeof (int));
ctx->msgcount = 0;
- count = imap_read_headers (idata, 0, count - 1) + 1;
+ if (imap_read_headers (idata, 0, count - 1) < 0)
+ {
+ mutt_error _("Error opening mailbox");
+ mutt_sleep (1);
+ goto fail;
+ }
dprint (2, (debugfile, "imap_open_mailbox: msgcount is %d\n", ctx->msgcount));
FREE (&mx.mbox);
diff --git a/imap/message.c b/imap/message.c
index c31f1e71..8b6b8cce 100644
--- a/imap/message.c
+++ b/imap/message.c
@@ -79,7 +79,11 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
* as they come in. */
mutt_mktemp (tempfile);
if (!(fp = safe_fopen (tempfile, "w+")))
+ {
+ mutt_error (_("Could not create temporary file %s"), tempfile);
+ mutt_sleep (2);
return -1;
+ }
unlink (tempfile);
/* make sure context has room to hold the mailbox */