fn copy_string(dst: *mut c_void, src: &str, max: usize) {
    unsafe {
        use std::cmp::min;
        use libc::{c_void, memset, memcpy};

        let dst = dst as *mut c_void;
        memset(dst, 0, max);
        memcpy(dst, src.as_ptr() as *const c_void, min(max, src.len()));
    }
}
/// Copy a string into a destination buffer.
///
/// String will be cut at `max` characters.
Copy a string into a destination buffer.
String will be cut at `max` characters.
Copy a string into a destination buffer . String will be cut at ` max ` characters .
fn copy_string(dst: *mut c_void, src: &str, max: usize) {
    unsafe {
        use std::cmp::min;
        use libc::{c_void, memset, memcpy};
        let dst = dst as *mut c_void;
        memset(dst, 0, max);
        memcpy(dst, src.as_ptr() as *const c_void, min(max, src.len()));
    }
}
fn copy_string ( dst : * mut c_void , src : & str , max : usize ) { unsafe { use std :: cmp :: min ; use libc :: { c_void , memset , memcpy } ; let dst = dst as * mut c_void ; memset ( dst , 0 , max ) ; memcpy ( dst , src . as_ptr ( ) as * const c_void , min ( max , src . len ( ) ) ) ; } }
Copy a string into a destination buffer.
Copy a string into a destination buffer .
dst
*mut c_void
src
&str
max
usize
dst
*mut c_void
src
&str
max
usize