* path.cc (getcwd): Allow NULL first argument.

This commit is contained in:
Christopher Faylor 2001-10-05 15:05:07 +00:00
parent b3fa795ab9
commit 19639f4139
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Fri Oct 5 11:05:32 2001 Christopher Faylor <cgf@cygnus.com>
* path.cc (getcwd): Allow NULL first argument.
Fri Oct 5 00:31:35 2001 Christopher Faylor <cgf@cygnus.com>
* heap.h (inheap): Check for NULL.

View File

@ -3011,7 +3011,7 @@ getcwd (char *buf, size_t ulen)
char* res = NULL;
if (ulen == 0)
set_errno (EINVAL);
else if (!__check_null_invalid_struct_errno (buf, ulen))
else if (buf == NULL || !__check_null_invalid_struct_errno (buf, ulen))
res = cygheap->cwd.get (buf, 1, 1, ulen);
return res;
}