Re: Fwd: report 3/3: latent unterminated buffer in imap_wordcasecmp()

Kurt Hackenberg <[email protected]> Fri, 19 Jun 2026 02:27:15 -0400
Newsgroups gmane.mail.mutt.devel
Message-ID <[email protected]>
On Fri, Jun 19, 2026 at 13:37 +0800, Kevin J. McCarthy wrote:

>Ah, sorry, that's right.  I meant to propose ascii_strncasecmp()

I assumed that. Question is, do we have to call some external function 
to do that caseless compare, or can we code it directly in this function?

     int match;

     for (i = 0; ; i++)
         if ( !(match = (toupper(a[i]) == toupper(b[i])))
              || b[i] == '\0' || isspace(b[i]))
             break;

     return match;

Just whomped up, and untested.