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 <karl@mcs.com>, PR#1826
This commit is contained in:
parent
9c00f7f8e2
commit
1f0a73e693
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user