On Wed, 6 Mar 2024 at 20:09, Paul Smith <psm...@gnu.org> wrote: > 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? >
My point is that if BUF is NULL, an array is allocated with 'malloc'. It has nothing to do with being on a GNU or non-GNU system.