[dovecot-cvs] dovecot/src/lib compat.c,1.23,1.24

tss at dovecot.org tss at dovecot.org
Sat Nov 18 21:09:52 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv4400

Modified Files:
	compat.c 
Log Message:
my_strncasecmp() was broken.



Index: compat.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/compat.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- compat.c	12 Jul 2005 13:04:36 -0000	1.23
+++ compat.c	18 Nov 2006 21:09:49 -0000	1.24
@@ -34,9 +34,9 @@
 
 int my_strncasecmp(const char *s1, const char *s2, size_t max_chars)
 {
-	while (max_chars > 0 && *s1 != '\0' &&
+	while (max_chars > 1 && *s1 != '\0' &&
 	       i_toupper(*s1) == i_toupper(*s2)) {
-		s1++; s2++;
+		s1++; s2++; max_chars--;
 	}
 
         return i_toupper(*s1) - i_toupper(*s2);



More information about the dovecot-cvs mailing list