Skip to content

Commit 1f85341

Browse files
committed
Windows fixes
1 parent e3925e1 commit 1f85341

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/sys/windows/backtrace.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/// this takes the route of using StackWalk64 in order to walk the stack.
2323
2424
use c_str::CString;
25+
use core::ops::Index;
2526
use intrinsics;
2627
use io::{IoResult, Writer};
2728
use libc;
@@ -361,7 +362,7 @@ pub fn write(w: &mut Writer) -> IoResult<()> {
361362
let bytes = cstr.as_bytes();
362363
match cstr.as_str() {
363364
Some(s) => try!(demangle(w, s)),
364-
None => try!(w.write(bytes[..bytes.len()-1])),
365+
None => try!(w.write(bytes.index(&(..(bytes.len()-1))))),
365366
}
366367
}
367368
try!(w.write(&['\n' as u8]));

0 commit comments

Comments
 (0)