]> granicus.if.org Git - mutt/commitdiff
fix signed/unsigned comparison in longest_common_prefix
authorBrendan Cully <brendan@kublai.com>
Sat, 8 Jul 2017 23:35:08 +0000 (16:35 -0700)
committerBrendan Cully <brendan@kublai.com>
Sat, 8 Jul 2017 23:35:08 +0000 (16:35 -0700)
imap/imap.c

index a3b9e1e525e17bf96d994cedce2ffb9fcdabe8e2..2c5d4c636faff7ee97d9977bebefad61dd79d76a 100644 (file)
@@ -1950,10 +1950,10 @@ int imap_subscribe (char *path, int subscribe)
 
 /* trim dest to the length of the longest prefix it shares with src,
  * returning the length of the trimmed string */
-static int
-longest_common_prefix (char *dest, const char* src, int start, size_t dlen)
+static size_t
+longest_common_prefix (char *dest, const char* src, size_t start, size_t dlen)
 {
-  int pos = start;
+  size_t pos = start;
 
   while (pos < dlen && dest[pos] && dest[pos] == src[pos])
     pos++;
@@ -1970,7 +1970,7 @@ imap_complete_hosts (char *dest, size_t len)
   BUFFY* mailbox;
   CONNECTION* conn;
   int rc = -1;
-  int matchlen;
+  size_t matchlen;
 
   matchlen = mutt_strlen (dest);
   for (mailbox = Incoming; mailbox; mailbox = mailbox->next)
@@ -2023,7 +2023,8 @@ int imap_complete(char* dest, size_t dlen, char* path) {
   char buf[LONG_STRING];
   IMAP_LIST listresp;
   char completion[LONG_STRING];
-  int clen, matchlen = 0;
+  int clen;
+  size_t matchlen = 0;
   int completions = 0;
   IMAP_MBOX mx;
   int rc;