X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgetcwd-lgpl.c;h=27614228a0dafd13005453055035145583a9468e;hb=efbbfb91034a125333b7b147bc6a32170b25c890;hp=a5596f8869c04735fa1c2e48b41655b314ce7ddc;hpb=043be67acb94a724f96e3b18c3a09aefffd463af;p=gnulib.git diff --git a/lib/getcwd-lgpl.c b/lib/getcwd-lgpl.c index a5596f886..27614228a 100644 --- a/lib/getcwd-lgpl.c +++ b/lib/getcwd-lgpl.c @@ -45,7 +45,14 @@ rpl_getcwd (char *buf, size_t size) /* Handle single size operations. */ if (buf) - return getcwd (buf, size); + { + if (!size) + { + errno = EINVAL; + return NULL; + } + return getcwd (buf, size); + } if (size) { @@ -53,7 +60,7 @@ rpl_getcwd (char *buf, size_t size) if (!buf) { errno = ENOMEM; - return -1; + return NULL; } result = getcwd (buf, size); if (!result)