From b1f52c0d6148cd3a807a94f996d64903610b75c8 Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Tue, 10 Apr 2007 19:23:16 -0700 Subject: [PATCH] Fix some warnings --- ChangeLog | 6 +++++- bcache.c | 1 - imap/imap.c | 3 --- imap/util.c | 2 +- lib.c | 6 ++++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bd7c7a77..4e51651e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2007-04-10 17:40 -0700 Brendan Cully (8082e4c9f524) +2007-04-10 19:19 -0700 Brendan Cully (ddd38b4cf15c) + + * hcache.c: Refactor mutt_hcache_open to share more code + + * hcache.c: Save some stats when header cache already exists * hcache.c, imap/imap.c, imap/imap_private.h, imap/message.c, imap/util.c: Make IMAP header cache layout match body cache. You can diff --git a/bcache.c b/bcache.c index dbdc34672..ac0784925 100644 --- a/bcache.c +++ b/bcache.c @@ -42,7 +42,6 @@ static int bcache_path(ACCOUNT *account, const char *mailbox, char *dst, size_t dstlen) { char host[STRING]; - char *s, *p; ciss_url_t url; size_t len; diff --git a/imap/imap.c b/imap/imap.c index e192f8410..4030c9131 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1567,9 +1567,6 @@ IMAP_STATUS* imap_mboxcache_get (IMAP_DATA* idata, const char* mbox, int create) IMAP_STATUS scache; #ifdef USE_HCACHE header_cache_t *hc = NULL; - ciss_url_t url; - char urlstr[LONG_STRING]; - char cpath[LONG_STRING]; unsigned int *uidvalidity = NULL; unsigned int *uidnext = NULL; #endif diff --git a/imap/util.c b/imap/util.c index 076c75877..fff96e229 100644 --- a/imap/util.c +++ b/imap/util.c @@ -84,7 +84,7 @@ header_cache_t* imap_hcache_open (IMAP_DATA* idata, const char* path) char mbox[LONG_STRING]; if (imap_parse_path (idata->ctx->path, &mx) < 0) - return -1; + return NULL; if (path) imap_cachepath (idata, path, mbox, sizeof (mbox)); diff --git a/lib.c b/lib.c index 4113af654..05f00c68e 100644 --- a/lib.c +++ b/lib.c @@ -866,11 +866,14 @@ void mutt_remove_trailing_ws (char *s) char *mutt_concatn_path (char *dst, size_t dstlen, const char *dir, size_t dirlen, const char *fname, size_t fnamelen) { + size_t req; + size_t offset = 0; + if (dstlen == 0) return NULL; /* probably should not mask errors like this */ /* size check */ - size_t req = dirlen + fnamelen + 1; /* +1 for the trailing nul */ + req = dirlen + fnamelen + 1; /* +1 for the trailing nul */ if (dirlen && fnamelen) req++; /* when both components are non-nul, we add a "/" in between */ if (req > dstlen) { /* check for condition where the dst length is too short */ @@ -884,7 +887,6 @@ char *mutt_concatn_path (char *dst, size_t dstlen, return NULL; } - size_t offset = 0; if (dirlen) { /* when dir is not empty */ memcpy(dst, dir, dirlen); offset = dirlen; -- 2.40.0