From: Paul Eggert Date: Mon, 19 Mar 2007 17:30:07 +0000 (+0000) Subject: * lib/getcwd.c (__getcwd): Remove redundant comparison of buf to NULL. X-Git-Tag: cvs-readonly~744 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=4b57b2a1cba017e176f1992304b8c2900bbdb569;p=gnulib.git * lib/getcwd.c (__getcwd): Remove redundant comparison of buf to NULL. If size is zero here, buf must be zero. --- diff --git a/ChangeLog b/ChangeLog index fd9f3e845..aa3f36314 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-19 Paul Eggert + + * 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 * des.c: Remove weak_keys_chksum. Reported by Bruno Haible diff --git a/lib/getcwd.c b/lib/getcwd.c index f8567bd73..23b35de67 100644 --- a/lib/getcwd.c +++ b/lib/getcwd.c @@ -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);