* lib/getcwd.c (__getcwd): Remove redundant comparison of buf to NULL.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Mar 2007 17:30:07 +0000 (17:30 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Mar 2007 17:30:07 +0000 (17:30 +0000)
If size is zero here, buf must be zero.

ChangeLog
lib/getcwd.c

index fd9f3e8..aa3f363 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/getcwd.c (__getcwd): Remove redundant comparison of buf to NULL.
+       If size is zero here, buf must be zero.
+
 2007-03-19  Simon Josefsson  <simon@josefsson.org>
 
        * des.c: Remove weak_keys_chksum.  Reported by Bruno Haible
index f8567bd..23b35de 100644 (file)
@@ -391,7 +391,7 @@ __getcwd (char *buf, size_t size)
   used = dir + allocated - dirp;
   memmove (dir, dirp, used);
 
-  if (buf == NULL && size == 0)
+  if (size == 0)
     /* Ensure that the buffer is only as large as necessary.  */
     buf = realloc (dir, used);