, because the assertion avoids the calling the function with valid parameters as described in an extension to the POSIX.1-2001 standard: glibc's getcwd() allocates the buffer dynamically using malloc(3) if buf is NULL. In this case, the allocated buffer has the length size unless size is zero, when buf is allocated as big as necessary.
, because the assertion avoids the calling the function with valid parameters as described in an extension to the POSIX.1-2001 standard: glibc's getcwd() allocates the buffer dynamically using malloc(3) if buf is NULL. In this case, the allocated buffer has the length size unless size is zero, when buf is allocated as big as necessary.