changeset: 7101:952e4fcf1e2b
user: Brendan Cully <[email protected]>
date: Sat Jul 08 16:35:08 2017 -0700
link: http://dev.mutt.org/hg/mutt/rev/952e4fcf1e2b
fix signed/unsigned comparison in longest_common_prefix
diffs (36 lines):
diff -r 428e36fb2262 -r 952e4fcf1e2b imap/imap.c
--- a/imap/imap.c Wed Jul 05 19:09:51 2017 -0700
+++ b/imap/imap.c Sat Jul 08 16:35:08 2017 -0700
@@ -1950,10 +1950,10 @@
/* 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 @@
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 @@
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;