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

Derek Martin invalid at pizzashack.org
Tue May 1 17:54:12 UTC 2018


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.

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-dev/attachments/20180501/b751a148/attachment.asc>


More information about the Mutt-dev mailing list