Lossily convert recieved data on screen output

This commit is contained in:
pjht 2024-11-08 14:54:36 -06:00
parent aedc6f5cb4
commit 527dfefd40
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -357,10 +357,11 @@ impl file_rpc::Server for FileServ {
#[allow(clippy::significant_drop_tightening)] #[allow(clippy::significant_drop_tightening)]
fn write(&self, _fd: u64, data: &[u8]) -> Result<(), Errno> { fn write(&self, _fd: u64, data: &[u8]) -> Result<(), Errno> {
let string = str::from_utf8(data).map_err(|_| Errno::EINVALDAT)?; //let string = str::from_utf8(data).map_err(|_| Errno::EINVALDAT)?;
let string = String::from_utf8_lossy(data);
let mut fbwriter = self.fbwriter.lock(); let mut fbwriter = self.fbwriter.lock();
let mut fbuffer = self.fbuffer.lock(); let mut fbuffer = self.fbuffer.lock();
let _ = fbwriter.write_str(string); // never errors let _ = fbwriter.write_str(&*string); // never errors
fbwriter.update_screen(&mut fbuffer); fbwriter.update_screen(&mut fbuffer);
Ok(()) Ok(())
} }