From 3e10765148ccc42bedeb28d995d2661b62ce2161 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Sun, 6 Jan 2019 23:31:52 -0600 Subject: [PATCH] Fix _localtime_r --- src/apis/emscripten/time.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/emscripten/time.rs b/src/apis/emscripten/time.rs index a29b3079b..980c452be 100644 --- a/src/apis/emscripten/time.rs +++ b/src/apis/emscripten/time.rs @@ -226,8 +226,8 @@ pub extern "C" fn _localtime_r(time_p: u32, result: u32, instance: &mut Instance // https://stackoverflow.com/questions/19170721/real-time-awareness-of-timezone-change-in-localtime-vs-localtime-r unsafe { - let seconds = instance.memory_offset_addr(0, time_p as _) as *const i64; - let timespec = time::Timespec::new(*seconds, 0); + let seconds = instance.memory_offset_addr(0, time_p as _) as *const i32; + let timespec = time::Timespec::new(*seconds as _, 0); let result_tm = time::at(timespec); // debug!(