fix call to getcwd allowing wide pointers