diff --git a/bch_bindgen/src/lib.rs b/bch_bindgen/src/lib.rs index deb69a51..ea49e60b 100644 --- a/bch_bindgen/src/lib.rs +++ b/bch_bindgen/src/lib.rs @@ -164,5 +164,5 @@ pub fn printbuf_to_formatter(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()) }