[PATCH] Add ~M pattern to match mime Content-Types.

Kevin J. McCarthy kevin at 8t8.us
Tue May 1 18:15:51 UTC 2018


On Tue, May 01, 2018 at 12:54:12PM -0500, Derek Martin wrote:
> On Tue, May 01, 2018 at 11:59:27AM -0500, Derek Martin wrote:
> > FWIW, I've said this before, but I think anywhere strncpy() is used,
> > code that does the above should replace it.  This avoids silent
> > truncation (which strncpy() does), and checking the return is required
> > to make sure snprintf() actually did something, and you're not
> > operating on uninitialized memory (or whatever).
> 
> Sorry, this was badly worded.  Checking the return value is required
> to ensure that snprintf() wrote all the data (rc < size, NOT <= size),
> assuming you want that.  If you actually want it to silently truncate,
> which you may if for example you're formatting the index, then you can
> ignore it.  That may or may not cause an error if compiled with -Wall
> -Werror flags... the glibc folks have been doing a lot of that lately.

Hi Derek,

I haven't forgotten or ignored your past emails, and this is still on my
list.  I've been thinking about a couple ways to deal with this, that
I'll try after this release.  The nice thing about the static buffers is
the speed, but I've been thinking of allocating a pool of BUFFER of
various sizes and using that for the critical parts of the code.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-dev/attachments/20180501/38e77f36/attachment.asc>


More information about the Mutt-dev mailing list