From 1f0a73e693d31858dc98e66348f42bd46298e945 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 17 Oct 1996 00:40:04 +0000 Subject: [PATCH] Corrently null-terminate the path being passed to the opendir() calls, malloc() does is not defined to return a zeroed buffer leading to "strange" problems. Submitted by: Karl Denninger , PR#1826 --- lib/libc/gen/getcwd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c index d3f58140c2e2..dfa482aeec81 100644 --- a/lib/libc/gen/getcwd.c +++ b/lib/libc/gen/getcwd.c @@ -154,6 +154,7 @@ getcwd(pt, size) /* Add trailing slash for next directory. */ *bup++ = '/'; + *bup = '\0'; /* * If it's a mount point, have to stat each element because