projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
refactor setxid return path to use __syscall_ret
[musl]
/
src
/
unistd
/
getcwd.c
diff --git
a/src/unistd/getcwd.c
b/src/unistd/getcwd.c
index
103fbbb
..
f407ffe
100644
(file)
--- a/
src/unistd/getcwd.c
+++ b/
src/unistd/getcwd.c
@@
-6,10
+6,10
@@
char *getcwd(char *buf, size_t size)
{
- char tmp[PATH_MAX];
+ char tmp[
buf ? 1 :
PATH_MAX];
if (!buf) {
buf = tmp;
- size =
PATH_MAX
;
+ size =
sizeof tmp
;
} else if (!size) {
errno = EINVAL;
return 0;