On Mon, Aug 22, 2011 at 8:52 AM, Dave Reisner <[email protected]> wrote:
> On Mon, Aug 22, 2011 at 08:41:34AM -0500, Dan McGee wrote:
>> On Mon, Aug 22, 2011 at 12:00 AM, Pang Yan Han <[email protected]> wrote:
>> > Signed-off-by: Pang Yan Han <[email protected]>
>> > ---
>> > Pointer sizes are the same but this makes intention clearer.
>> This comment is on point enough to actually make it in the commit
>> message, so I did just that.
>>
>
> I don't agree with that point though, since the intention really is to
> allocate for an array of char *, not just a char *.

However, you are using calloc, which is a type and a count.

char *ptr = calloc(size, sizeof(char));
char **ptrs = calloc(size, sizeof(char *));

Note that the realloc() call in list_grow already used sizeof(char *)
rather than the ** variant.

-Dan

Reply via email to