Fix build warning unnecessary unsafe

This commit is contained in:
Brandon Fish 2018-12-13 19:58:08 -06:00
parent 2c2d21044f
commit e583226510

View File

@ -20,11 +20,9 @@ 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 _);
}
}
buf
}