1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-21 20:27:46 +00:00

Patch fixing redux: Trim trailing null characters

This fixes broken file operations
This commit is contained in:
Joshua Goins 2024-07-18 14:08:10 -04:00
parent 4d23bf9f08
commit 66034b6e8d

View file

@ -19,7 +19,8 @@ pub(crate) fn write_bool_as<T: std::convert::From<u8>>(x: &bool) -> T {
}
pub(crate) fn read_string(byte_stream: Vec<u8>) -> 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<u8> {