Browse Source

this [u8] to c_char* is probably wrong

Paul Sajna 7 years ago
parent
commit
fc92d95b35
1 changed files with 4 additions and 1 deletions
  1. 4 1
      platform/src/redox/mod.rs

+ 4 - 1
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 {