always use to_string_lossy() for converting c-strings to String

the function to_string() is removed;
c-strings may always be badly formatted and this should never lead to a panic.
This commit is contained in:
B. Petersen
2019-10-04 23:23:58 +02:00
parent 93f0f5ccae
commit 735bdd1c20
10 changed files with 21 additions and 37 deletions

View File

@@ -688,8 +688,8 @@ unsafe fn add_parts(
} else {
None
},
to_string(mime_in_reply_to),
to_string(mime_references),
to_string_lossy(mime_in_reply_to),
to_string_lossy(mime_references),
])?;
txt_raw = None;
@@ -1026,7 +1026,7 @@ unsafe fn create_or_lookup_group(
{
let fld_in_reply_to = (*field).fld_data.fld_in_reply_to;
if !fld_in_reply_to.is_null() {
grpid = to_string(dc_extract_grpid_from_rfc724_mid_list(
grpid = to_string_lossy(dc_extract_grpid_from_rfc724_mid_list(
(*fld_in_reply_to).mid_list,
));
}
@@ -1037,7 +1037,7 @@ unsafe fn create_or_lookup_group(
{
let fld_references = (*field).fld_data.fld_references;
if !fld_references.is_null() {
grpid = to_string(dc_extract_grpid_from_rfc724_mid_list(
grpid = to_string_lossy(dc_extract_grpid_from_rfc724_mid_list(
(*fld_references).mid_list,
));
}