Skip to content

Commit e7f0882

Browse files
committed
Fix a stack to use the new .to_c_str() api
1 parent a54476b commit e7f0882

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/run-pass/c-stack-returning-int64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ mod libc {
2020
}
2121

2222
fn atol(s: ~str) -> int {
23-
s.as_imm_buf(|x, _len| unsafe { libc::atol(x) })
23+
s.to_c_str().with_ref(|x| unsafe { libc::atol(x as *u8) })
2424
}
2525

2626
fn atoll(s: ~str) -> i64 {
27-
s.as_imm_buf(|x, _len| unsafe { libc::atoll(x) })
27+
s.to_c_str().with_ref(|x| unsafe { libc::atoll(x as *u8) })
2828
}
2929

3030
pub fn main() {

0 commit comments

Comments
 (0)