projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stdalign tests: Skip the test when compiled by Sun C.
[gnulib.git]
/
lib
/
getcwd-lgpl.c
diff --git
a/lib/getcwd-lgpl.c
b/lib/getcwd-lgpl.c
index
a5596f8
..
2761422
100644
(file)
--- 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)
/* Handle single size operations. */
if (buf)
- return getcwd (buf, size);
+ {
+ if (!size)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+ return getcwd (buf, size);
+ }
if (size)
{
if (size)
{
@@
-53,7
+60,7
@@
rpl_getcwd (char *buf, size_t size)
if (!buf)
{
errno = ENOMEM;
if (!buf)
{
errno = ENOMEM;
- return
-1
;
+ return
NULL
;
}
result = getcwd (buf, size);
if (!result)
}
result = getcwd (buf, size);
if (!result)