mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
print invalid strings
This commit is contained in:
committed by
holger krekel
parent
aaa5b820d9
commit
e7a236264a
@@ -1561,6 +1561,11 @@ pub fn to_string(s: *const libc::c_char) -> String {
|
||||
let cstr = unsafe { CStr::from_ptr(s) };
|
||||
|
||||
cstr.to_str().map(|s| s.to_string()).unwrap_or_else(|err| {
|
||||
eprintln!(
|
||||
"Non utf8 string: '{:?}' ({:?})",
|
||||
cstr.to_string_lossy(),
|
||||
err
|
||||
);
|
||||
panic!("Non utf8 string: '{:?}' ({:?})", cstr.to_bytes(), err);
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user