diff --git a/src/common_file_operations.rs b/src/common_file_operations.rs index 2295426..88b5ace 100644 --- a/src/common_file_operations.rs +++ b/src/common_file_operations.rs @@ -19,7 +19,8 @@ pub(crate) fn write_bool_as>(x: &bool) -> T { } pub(crate) fn read_string(byte_stream: Vec) -> String { - String::from_utf8(byte_stream).unwrap() + let str = String::from_utf8(byte_stream).unwrap(); + str.trim_matches(char::from(0)).to_string() // trim \0 from the end of strings } pub(crate) fn write_string(str: &String) -> Vec {