On Sat, Jan 3, 2015 at 1:38 AM, tito <[email protected]> wrote:
> If I understand it correctly now we use our internal malloced buffer
> also for the _r functions and copy the results to the user supplied buffer?
Yes.
> Also I wonder about:
>
> while ((buf = xmalloc_fgetline(fp)) != NULL) {
>
> if we use it to allocate a buffer holding the complete line from e.g
> /etc/group
>
> that includes already group members why do we need to realloc it later...
We need a place where struct group->gr_mem[] array will reside.
I decided to place it beyond the terminating NUL of the line
read by xmalloc_fgetline().
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox