From fc92d95b359e5220f2a8dbba5871625a9f4499cd Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 4 Mar 2018 09:42:57 -0800 Subject: [PATCH] this [u8] to c_char* is probably wrong --- platform/src/redox/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/src/redox/mod.rs b/platform/src/redox/mod.rs index b9792e176d..4391daa03b 100644 --- a/platform/src/redox/mod.rs +++ b/platform/src/redox/mod.rs @@ -58,7 +58,10 @@ pub fn ftruncate(fd: c_int, len: off_t) -> { pub fn getcwd(buf: *mut c_char, size: size_t) -> { // XXX: do something with size maybe let rbuf = unsafe { c_str(buf) }; - syscall::getcwd(rbuf)? as c_int + syscall::getcwd(rbuf); + unsafe { + &*(rbuf as *mut [c_char]) + } } pub fn open(path: *const c_char, oflag: c_int, mode: mode_t) -> c_int {