From 527dfefd402f82658da15067b30c78ad0312f148 Mon Sep 17 00:00:00 2001 From: pjht Date: Fri, 8 Nov 2024 14:54:36 -0600 Subject: [PATCH] Lossily convert recieved data on screen output --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 35990b2..4194ca6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -357,10 +357,11 @@ impl file_rpc::Server for FileServ { #[allow(clippy::significant_drop_tightening)] 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 fbuffer = self.fbuffer.lock(); - let _ = fbwriter.write_str(string); // never errors + let _ = fbwriter.write_str(&*string); // never errors fbwriter.update_screen(&mut fbuffer); Ok(()) }