mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* sysdeps/posix/getcwd.c: Correct comment saying < 0 is ok for size type. [PR libc/1269]
This commit is contained in:
@ -72,7 +72,7 @@ __getcwd (char *buf, size_t size)
|
||||
if (no_syscall_getcwd && !have_new_dcache)
|
||||
return generic_getcwd (buf, size);
|
||||
|
||||
if (size <= 0)
|
||||
if (size == 0)
|
||||
{
|
||||
if (buf != NULL)
|
||||
{
|
||||
@ -179,7 +179,7 @@ __getcwd (char *buf, size_t size)
|
||||
__set_errno (save_errno);
|
||||
|
||||
/* Don't put restrictions on the length of the path unless the user does. */
|
||||
if (size <= 0)
|
||||
if (size == 0)
|
||||
{
|
||||
free (path);
|
||||
path = NULL;
|
||||
@ -187,7 +187,7 @@ __getcwd (char *buf, size_t size)
|
||||
|
||||
result = generic_getcwd (path, size);
|
||||
|
||||
if (result == NULL && buf == NULL && size > 0)
|
||||
if (result == NULL && buf == NULL && size != 0)
|
||||
free (path);
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user