ccsds_packet

Function fill_char_array

source
pub fn fill_char_array<S: AsRef<[u8]>, const N: usize>(
    string: &S,
    ensure_null_termination: bool,
) -> ([c_char; N], bool)
Expand description

Takes a str or String and uses it to populate an array of c_chars.

If ensure_null_termination is set, the last byte of the array is guaranteed to be '\0'.

Returns the array, as well as whether any bytes were truncated at the end of string.