]> git.nihav.org Git - nihav.git/blobdiff - nihav-core/src/io/byteio.rs
core/byteio: reexport SeekFrom
[nihav.git] / nihav-core / src / io / byteio.rs
index 545bff5c99ef6dee2754a87186cbff7962a8814d..217a85f036960e250fc176bd7d13dcfcf7a6a515 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::SeekFrom;
+pub use std::io::SeekFrom;
 use std::fs::File;
 use std::io::prelude::*;
 use std::ptr;
@@ -72,7 +72,7 @@ macro_rules! read_int_func {
             if src.len() < $size { return Err(ByteIOError::ReadError); }
             unsafe {
                 let mut buf: $inttype = 0;
-                ptr::copy_nonoverlapping(src.as_ptr(), &mut buf as *mut $inttype as *mut u8, 1);
+                ptr::copy_nonoverlapping(src.as_ptr(), &mut buf as *mut $inttype as *mut u8, std::mem::size_of::<$inttype>());
                 Ok(buf.$which())
             }
         }