about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-16 10:45:16 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-22 14:42:01 -0700
commit36195eb91f15975fed7555a3aa52807ecd5698a1 (patch)
treed0e99310be4a24e76b8d6b13f05ec79c1f89b6ba /src/libnative
parente402e75f4eb79af09b9451f0f232f994b3e2c998 (diff)
downloadrust-36195eb91f15975fed7555a3aa52807ecd5698a1.tar.gz
rust-36195eb91f15975fed7555a3aa52807ecd5698a1.zip
libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.
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",