MFC: r173282
Use getcwd() instead of getwd(). The former includes buffer length checks, so it's probably "safer" to use in mtree.