Skip to content

Commit

Permalink
Fix build warning unnecessary unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Dec 14, 2018
1 parent 2c2d210 commit e583226
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/apis/emscripten/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ pub fn is_emscripten_module(module: &Module) -> bool {
pub unsafe fn write_to_buf(string: *const c_char, buf: u32, max: u32, instance: &Instance) -> u32 {
let buf_addr = instance.memory_offset_addr(0, buf as _) as *mut c_char;

unsafe {
for i in 0..max {
*buf_addr.add(i as _) = *string.add(i as _);
}
for i in 0..max {
*buf_addr.add(i as _) = *string.add(i as _);
}

buf
Expand Down

0 comments on commit e583226

Please sign in to comment.