|
From: | Reuben Thomas |
Subject: | Re: Does gnulib getcwd always allocate if buf is NULL? |
Date: | Wed, 6 Mar 2024 20:23:14 +0100 |
On Wed, 2024-03-06 at 19:55 +0100, Reuben Thomas wrote:
> In getcwd.c I find the following comment:
>
> > In GNU, if BUF is NULL, an array is allocated with 'malloc'; the
> > array is SIZE bytes long, unless SIZE == 0, in which case it is as
> > big as necessary.
>
> However, as far as I can see from the code, it always allocates if
> BUF is NULL.
I don't think your observation contradicts the comment...is there more
to it?
[Prev in Thread] | Current Thread | [Next in Thread] |