On Wed, Apr 13, 2016 at 07:24:50AM -0700, Kevin J. McCarthy wrote:
> On Wed, Apr 13, 2016 at 10:34:31AM +0200, Vincent Lefevre wrote:
> > In this second patch:
> > 
> > +              pad = ((signed)(destlen - wlen - len)) / pl;
> > 
> > The cast to "signed" seems useless and confusing: what is its goal?
> 
> Thanks for taking a look at the patches.  That particular line was
> actually just moved from above the "if (pad >= 0)" to inside it.
> 
> I think because destlen, wlen, and len are all size_t, if wlen+len were
> larger then destlen the resulting subtraction could turn into a large
> value, instead of the desired negative number (e.g., if we ran out of
> space).

Actually, thank you, yourx point made me notice I need to fix the while
loop just below:

- while (pad--)
+ while (pad-- > 0)

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt

Attachment: signature.asc
Description: PGP signature

Reply via email to