* path.cc (getcwd): Allow len == 0 when buf == NULL.
This commit is contained in:
@ -3120,7 +3120,7 @@ char *
|
||||
getcwd (char *buf, size_t ulen)
|
||||
{
|
||||
char* res = NULL;
|
||||
if (ulen == 0)
|
||||
if (ulen == 0 && buf)
|
||||
set_errno (EINVAL);
|
||||
else if (buf == NULL || !__check_null_invalid_struct_errno (buf, ulen))
|
||||
res = cygheap->cwd.get (buf, 1, 1, ulen);
|
||||
|
Reference in New Issue
Block a user