about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getcwd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 886a0ba827..e79598b045 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -226,7 +226,7 @@ __getcwd (buf, size)
   int prev_errno = errno;
   size_t allocated = size;
 
-  if (size == 0)
+  if (size <= 0)
     {
       if (buf != NULL)
 	{
@@ -363,7 +363,7 @@ __getcwd (buf, size)
 
 	  if ((size_t) (pathp - path) <= namlen)
 	    {
-	      if (size != 0)
+	      if (size > 0)
 		{
 		  (void) __closedir (dirstream);
 		  __set_errno (ERANGE);