mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-09 00:00:04 +03:00
Merge pull request #228 from g2p/non-utf8-printbuf-display
printbuf_to_formatter: Lossy display of non-UTF-8 printbufs
This commit is contained in:
commit
f2f1b5c3ec
@ -164,5 +164,5 @@ pub fn printbuf_to_formatter<F>(f: &mut fmt::Formatter<'_>, func: F) -> fmt::Res
|
||||
func(&mut buf);
|
||||
|
||||
let s = unsafe { CStr::from_ptr(buf.buf) };
|
||||
f.write_str(s.to_str().unwrap())
|
||||
f.write_str(&s.to_string_lossy())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user