From 6df69d408651b922a4da25ee1c130216e152cd70 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 15 Sep 1997 08:25:14 +0000 Subject: Fix a buglet and a couple of stylistic nits from Bruce. --- lib/libc/gen/getcwd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libc/gen/getcwd.c') 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) { -- cgit v1.1