This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix readlink calls in GDB


On 11/26/2012 04:33 PM, Pierre Muller wrote:

>   Thank you for the answers,
> I am sorry to have wasted your time :(
>   I didn't know calloc was zeroing data...

No problem.

>   Does that mean that
>    name2 = xzalloc (MAXPATHLEN);
> or
>    name2 = xcalloc (MAXPATHLEN, 1);
>
> 
> could have replaced the two lines:
>>   name2 = xmalloc (MAXPATHLEN);
>>   memset (name2, 0, MAXPATHLEN);

Yep.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]