mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 06:56:29 +03:00
if in doubt, prefer unwrap_or_default()
if the past we had lots of crashes because of unexpected unwrap failures, mostly related to string. this commit avoids them eg. for string-conversions that may panic eg. when encountering a null-byte or by logical programming errors where an object is assumed to be set but is not under unexpected circumstances.
This commit is contained in:
@@ -1598,7 +1598,7 @@ unsafe fn mailimf_date_time_write_driver(
|
||||
(*date_time).dt_sec,
|
||||
(*date_time).dt_zone,
|
||||
);
|
||||
let date_str_c = std::ffi::CString::new(date_str).unwrap();
|
||||
let date_str_c = std::ffi::CString::new(date_str).unwrap_or_default();
|
||||
let r = mailimf_string_write_driver(
|
||||
do_write,
|
||||
data,
|
||||
|
||||
Reference in New Issue
Block a user