Lossily convert recieved data on screen output
This commit is contained in:
parent
aedc6f5cb4
commit
527dfefd40
@ -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(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user