Attached is a refreshed patch for mutt 1.8.0.
--
vvvvvvvvvvvvvvvvvv Email
    vvvvvv        Twitter
[email protected]
     ^^^^^^^^^^^^ Website
^^^^^^^^^^^^^^^^^^ XMPP
diff -u mutt-1.8.0.orig/imap/command.c mutt-1.8.0/imap/command.c
--- mutt-1.8.0.orig/imap/command.c  2017-05-30 09:56:25.000000000 +0100
+++ mutt-1.8.0/imap/command.c   2017-05-30 09:50:23.177949168 +0100
@@ -640,7 +640,7 @@
       
       if (h && h->active && h->index+1 == msgno)
       {
-   mutt_debug (2, "Message UID %d updated\n", HEADER_DATA(h)->uid);
+   mutt_debug (2, "Message UID %u updated\n", HEADER_DATA(h)->uid);
    break;
       }
       
@@ -872,7 +872,7 @@
 
   while ((s = imap_next_word ((char*)s)) && *s != '\0')
   {
-    uid = (unsigned int)atoi (s);
+    uid = strtoul (s, NULL, 10);
     h = (HEADER *)int_hash_find (idata->uid_hash, uid);
     if (h)
       h->matched = 1;
@@ -887,7 +887,7 @@
   char* value;
   BUFFY* inc;
   IMAP_MBOX mx;
-  int count;
+  unsigned int count;
   IMAP_STATUS *status;
   unsigned int olduv, oldun;
   long litlen;
@@ -929,7 +929,7 @@
   while (*s && *s != ')')
   {
     value = imap_next_word (s);
-    count = strtol (value, &value, 10);
+    count = strtoul (value, &value, 10);
 
     if (!ascii_strncmp ("MESSAGES", s, 8))
     {
@@ -949,7 +949,7 @@
     if (*s && *s != ')')
       s = imap_next_word (s);
   }
-  mutt_debug (3, "%s (UIDVALIDITY: %d, UIDNEXT: %d) %d messages, %d recent, %d unseen\n",
+  mutt_debug (3, "%s (UIDVALIDITY: %u, UIDNEXT: %u) %d messages, %d recent, %d unseen\n",
               status->name, status->uidvalidity, status->uidnext,
               status->messages, status->recent, status->unseen);
 
@@ -988,7 +988,7 @@
 
       if (value && !imap_mxcmp (mailbox, value))
       {
-        mutt_debug (3, "Found %s in buffy list (OV: %d ON: %d U: %d)\n",
+        mutt_debug (3, "Found %s in buffy list (OV: %u ON: %u U: %d)\n",
                     mailbox, olduv, oldun, status->unseen);
         
    if (option(OPTMAILCHECKRECENT))
diff -u mutt-1.8.0.orig/imap/imap.c mutt-1.8.0/imap/imap.c
--- mutt-1.8.0.orig/imap/imap.c 2017-05-30 09:56:25.000000000 +0100
+++ mutt-1.8.0/imap/imap.c  2017-05-30 09:52:28.558686827 +0100
@@ -261,7 +261,7 @@
 
     if (h->index == -1)
     {
-      mutt_debug (2, "Expunging message UID %d.\n", HEADER_DATA (h)->uid);
+      mutt_debug (2, "Expunging message UID %u.\n", HEADER_DATA (h)->uid);
 
       h->active = 0;
       idata->ctx->size -= h->content->length;
@@ -673,7 +673,7 @@
       mutt_debug (3, "Getting mailbox UIDVALIDITY\n");
       pc += 3;
       pc = imap_next_word (pc);
-      idata->uid_validity = strtol (pc, NULL, 10);
+      idata->uid_validity = strtoul (pc, NULL, 10);
       status->uidvalidity = idata->uid_validity;
     }
     else if (ascii_strncasecmp ("OK [UIDNEXT", pc, 11) == 0)
@@ -681,7 +681,7 @@
       mutt_debug (3, "Getting mailbox UIDNEXT\n");
       pc += 3;
       pc = imap_next_word (pc);
-      idata->uidnext = strtol (pc, NULL, 10);
+      idata->uidnext = strtoul (pc, NULL, 10);
       status->uidnext = idata->uidnext;
     }
     else
@@ -1684,7 +1684,7 @@
   if (hc)
   {
     uidvalidity = mutt_hcache_fetch_raw (hc, "/UIDVALIDITY", 12);
-    uidnext = mutt_hcache_fetch_raw (hc, "/UIDNEXT", 8);
+    uidnext = mutt_hcache_fetch_raw (hc, "/UIDNEXT", 12);
     if (uidvalidity)
     {
       if (!status)
diff -u mutt-1.8.0.orig/imap/message.c mutt-1.8.0/imap/message.c
--- mutt-1.8.0.orig/imap/message.c  2017-05-30 09:56:25.000000000 +0100
+++ mutt-1.8.0/imap/message.c   2017-05-30 09:55:48.771864749 +0100
@@ -85,7 +85,7 @@
   IMAP_STATUS* status;
   int rc, mfhrc, oldmsgcount;
   int fetchlast = 0;
-  int maxuid = 0;
+  unsigned int maxuid = 0;
   static const char * const want_headers = "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL X-KEYWORDS X-MOZILLA-KEYS KEYWORDS X-ORIGINAL-TO";
   progress_t progress;
   int retval = -1;
@@ -142,7 +142,7 @@
   if (idata->hcache && !msgbegin)
   {
     uid_validity = mutt_hcache_fetch_raw (idata->hcache, "/UIDVALIDITY", 12);
-    puidnext = mutt_hcache_fetch_raw (idata->hcache, "/UIDNEXT", 8);
+    puidnext = mutt_hcache_fetch_raw (idata->hcache, "/UIDNEXT", 12);
     if (puidnext)
     {
       uidnext = *(unsigned int *)puidnext;
@@ -384,7 +384,7 @@
     idata->uidnext = maxuid + 1;
   }
   if (idata->uidnext > 1)
-    mutt_hcache_store_raw (idata->hcache, "/UIDNEXT", 8,
+    mutt_hcache_store_raw (idata->hcache, "/UIDNEXT", 12,
             &idata->uidnext, sizeof (idata->uidnext));
 
   imap_hcache_close (idata);
@@ -420,8 +420,8 @@
   char *pc;
   long bytes;
   progress_t progressbar, *pbar;
-  int uid;
-  int cacheno;
+  unsigned int uid;
+  unsigned int cacheno;
   IMAP_CACHE *cache;
   int read;
   int rc;
@@ -504,7 +504,7 @@
    if (ascii_strncasecmp ("UID", pc, 3) == 0)
    {
      pc = imap_next_word (pc);
-     uid = atoi (pc);
+     uid = strtoul (pc, NULL, 10);
      if (uid != HEADER_DATA(h)->uid)
        mutt_error (_("The message index is incorrect. Try reopening the mailbox."));
    }
@@ -1136,7 +1136,7 @@
 
   /* skip to message number */
   buf = imap_next_word (buf);
-  h->sid = atoi (buf);
+  h->sid = strtoul (buf, NULL, 10);
 
   /* find FETCH tag */
   buf = imap_next_word (buf);
@@ -1199,7 +1199,7 @@
     {
       s += 3;
       SKIPWS (s);
-      h->data->uid = (unsigned int) atoi (s);
+      h->data->uid = (unsigned int) strtoul (s, NULL, 10);
 
       s = imap_next_word (s);
     }

Attachment: signature.asc
Description: PGP signature



Reply via email to