X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mh.c;h=5ca542f1b640c4024f74323f16346892ef98c723;hp=f108bf919c39113dd8000bdb8847e22414045e9d;hb=9eb3b25249e78d778b6d0583b06a7c5615709e63;hpb=22cf8192743cfba2e07776dadbc523676bdb3fe6 diff --git a/mh.c b/mh.c index f108bf9..5ca542f 100644 --- a/mh.c +++ b/mh.c @@ -17,23 +17,6 @@ # include "config.h" #endif -#include -#include -#include -#include - -#include "mutt.h" -#include "mx.h" -#include "mh.h" -#include "mbox.h" -#include "copy.h" -#include "buffy.h" -#include "sort.h" -#include "thread.h" -#include "hcache.h" - -#include "lib/debug.h" - #include #include #include @@ -52,6 +35,22 @@ #include #endif +#include +#include +#include +#include +#include + +#include "mutt.h" +#include "mx.h" +#include "mh.h" +#include "mbox.h" +#include "copy.h" +#include "buffy.h" +#include "sort.h" +#include "thread.h" +#include "hcache.h" + struct maildir { HEADER *h; char *canon_fname; @@ -142,7 +141,7 @@ static void mh_read_sequences (struct mh_sequences *mhs, const char *path) int line = 1; char *buff = NULL; char *t; - size_t sz = 0; + ssize_t sz = 0; short f; int first, last; @@ -273,7 +272,7 @@ void mh_update_sequences (CONTEXT * ctx) char *tmpfname; char *buff = NULL; char *p; - size_t s; + ssize_t s; int l = 0; int i; @@ -384,7 +383,7 @@ static void mh_sequences_add_one (CONTEXT * ctx, int n, short unseen, char *buff = NULL; int line; - size_t sz; + ssize_t sz; if (mh_mkstemp (ctx, &nfp, &tmpfname) == -1) return; @@ -755,11 +754,9 @@ static int maildir_move_to_context (CONTEXT * ctx, struct maildir **md) } #ifdef USE_HCACHE -static size_t maildir_hcache_keylen (const char *fn) +static ssize_t maildir_hcache_keylen (const char *fn) { - const char *p = strchr (fn, ':'); - - return p ? (size_t) (p - fn) : m_strlen(fn); + return m_strchrnul(fn, ':') - fn; } #endif @@ -897,7 +894,7 @@ int ch_compar (const void *a, const void *b) return (int) (*((const char *) a) - *((const char *) b)); } -static void maildir_flags (char *dest, size_t destlen, HEADER * hdr) +static void maildir_flags (char *dest, ssize_t destlen, HEADER * hdr) { *dest = '\0'; @@ -1386,7 +1383,7 @@ err: return -1; } -static char *maildir_canon_filename (char *dest, const char *src, size_t l) +static char *maildir_canon_filename (char *dest, const char *src, ssize_t l) { char *t, *u;