From: Thomas Roessler Date: Tue, 5 Feb 2002 22:01:06 +0000 (+0000) Subject: The previous fix was complete nonsense. What a day. :-( X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c9a4a79488dde8673b8c0be77f8d5c640bf4fd6;p=neomutt The previous fix was complete nonsense. What a day. :-( --- diff --git a/ascii.c b/ascii.c index 59dfb440d..d4553f683 100644 --- a/ascii.c +++ b/ascii.c @@ -67,13 +67,13 @@ int ascii_strcasecmp (const char *a, const char *b) if (b == NULL && a) return 1; - for (; *a && *b; a++, b++) + for (; *a || *b; a++, b++) { if ((i = ascii_tolower (*a) - ascii_tolower (*b))) return i; } - - return ascii_tolower (*a) - ascii_tolower (*b); + + return 0; } int ascii_strncasecmp (const char *a, const char *b, int n) @@ -87,13 +87,11 @@ int ascii_strncasecmp (const char *a, const char *b, int n) if (b == NULL && a) return 1; - for (j = 0; (*a && *b) && j < n; a++, b++, j++) + for (j = 0; (*a || *b) && j < n; a++, b++, j++) { if ((i = ascii_tolower (*a) - ascii_tolower (*b))) return i; } - if (j < n) - return ascii_tolower (*a) - ascii_tolower (*b); - else - return 0; + + return 0; }