diff options
Diffstat (limited to 'lib/libc/gen/getcwd.c')
-rw-r--r-- | lib/libc/gen/getcwd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c index eb48b5a..9f27e90 100644 --- a/lib/libc/gen/getcwd.c +++ b/lib/libc/gen/getcwd.c @@ -66,7 +66,7 @@ getcwd(pt, size) ino_t root_ino; size_t ptsize, upsize; int save_errno; - char *ept, *eup, *up; + char *ept, *eup, *up, c; /* * If no buffer specified by the user, allocate one as necessary. @@ -89,8 +89,7 @@ getcwd(pt, size) return (NULL); ept = pt + ptsize; } - if (!__getcwd(pt,ptsize)) { - char c; + if (!__getcwd(pt, ept-pt)) { bpt = pt; ept = pt + strlen(pt) - 1; while (bpt < ept) { |