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

2018-05-01 Thread Derek Martin
On Thu, Apr 26, 2018 at 05:34:16PM -0700, Kevin J. McCarthy wrote: > On Thu, Apr 26, 2018 at 05:14:27PM -0700, Ammon Riley wrote: > > > The =b/=B/=h are explicity mentioned because of their IMAP behavior. > > > > I did copy the =b/=B. I hadn't considered IMAP for this feature, as I'm > > not usin

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

2018-05-01 Thread Derek Martin
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() a

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

2018-05-01 Thread Ammon Riley
On Tue, May 1, 2018 at 10:54 AM, 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

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

2018-05-01 Thread Kevin J. McCarthy
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()

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

2018-05-01 Thread Derek Martin
On Tue, May 01, 2018 at 11:15:51AM -0700, Kevin J. McCarthy wrote: [re: strncpy vs. snprintf...] > > 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 t