[PATCH] fix to malloc checking
James Lemke
jwlemke@codesourcery.com
Wed Apr 15 15:04:00 GMT 2015
On 04/12/2015 04:09 AM, Mike Frysinger wrote:
> On 08 Apr 2015 11:41, James Lemke wrote:
>> + block_sz = i - req_sz;
>> + if (block_sz > 0xff)
>> + block_sz = 0xff;
>
> these three lines can be written:
> block_sz = min (i - req_sz, 0xff);
>
>> + /* Don't allow the magic byte to appear in the chain of length bytes.
>> + For the following to work, magicbyte() cannot return 0x01. */
>
> GNU style says to omit the () in comments
>
>> + m_ptr[i] = (unsigned char) block_sz;
>
> i wonder if the cast is really needed ... they're both unsigned already
>
> otherwise patch looks fine to me
I've incorporated your three suggestions. Tests are OK.
The updated patch is attached. OK to commit?
Jim.
--
Jim Lemke, GNU Tools Sourcerer
Mentor Graphics / CodeSourcery
Orillia, Ontario
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14619-gli-0414a.diff
Type: text/x-diff
Size: 4659 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150415/15beb6bd/attachment.bin>
More information about the Libc-alpha
mailing list