Re: (int)sizeof in smtpd

2014-05-08 Thread Alexandre Ratchov
On Thu, May 08, 2014 at 12:35:56PM -0400, Ted Unangst wrote: This is wrong in several ways. Never cast sizeof down, always cast the comparison variable up. I'll specifically call out this change: - if (snprintf(buf, sizeof(buf)) = (int)sizeof(buf)) + if ((size_t)snprintf(buf,

Re: (int)sizeof in smtpd

2014-05-08 Thread Franco Fichtner
On 08 May 2014, at 18:43, Alexandre Ratchov a...@caoua.org wrote: On Thu, May 08, 2014 at 12:35:56PM -0400, Ted Unangst wrote: This is wrong in several ways. Never cast sizeof down, always cast the comparison variable up. I'll specifically call out this change: -if (snprintf(buf,

Re: (int)sizeof in smtpd

2014-05-08 Thread Ted Unangst
On Thu, May 08, 2014 at 18:43, Alexandre Ratchov wrote: On Thu, May 08, 2014 at 12:35:56PM -0400, Ted Unangst wrote: This is wrong in several ways. Never cast sizeof down, always cast the comparison variable up. I'll specifically call out this change: -if (snprintf(buf, sizeof(buf))