about summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/path')
-rw-r--r--src/libstd/path/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index ed0ce201750..13496033fd0 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -578,8 +578,7 @@ impl BytesContainer for ~[u8] {
 impl BytesContainer for CString {
     #[inline]
     fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
-        let s = self.as_bytes();
-        s.slice_to(s.len()-1)
+        self.as_bytes_no_nul()
     }
 }