about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnative')
-rw-r--r--src/libnative/io/addrinfo.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libnative/io/addrinfo.rs b/src/libnative/io/addrinfo.rs
index 8ebae70f73c..64b082d9f3f 100644
--- a/src/libnative/io/addrinfo.rs
+++ b/src/libnative/io/addrinfo.rs
@@ -104,9 +104,10 @@ fn get_error(_: c_int) -> IoError {
 #[cfg(not(windows))]
 fn get_error(s: c_int) -> IoError {
     use std::io;
-    use std::str::raw::from_c_str;
 
-    let err_str = unsafe { from_c_str(gai_strerror(s)) };
+    let err_str = unsafe {
+        CString::new(gai_strerror(s), false).as_str().unwrap().to_strbuf()
+    };
     IoError {
         kind: io::OtherIoError,
         desc: "unable to resolve host",