mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
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:
@@ -25,7 +25,7 @@ use num_traits::{FromPrimitive, ToPrimitive};
|
||||
use deltachat::contact::Contact;
|
||||
use deltachat::context::Context;
|
||||
use deltachat::dc_tools::{
|
||||
as_path, as_str, dc_strdup, to_string, to_string_lossy, OsStrExt, StrExt,
|
||||
as_path, as_str, dc_strdup, to_string_lossy, OsStrExt, StrExt,
|
||||
};
|
||||
use deltachat::*;
|
||||
|
||||
@@ -381,8 +381,8 @@ pub unsafe extern "C" fn dc_get_oauth2_url(
|
||||
return ptr::null_mut(); // NULL explicitly defined as "unknown"
|
||||
}
|
||||
let ffi_context = &*context;
|
||||
let addr = to_string(addr);
|
||||
let redirect = to_string(redirect);
|
||||
let addr = to_string_lossy(addr);
|
||||
let redirect = to_string_lossy(redirect);
|
||||
ffi_context
|
||||
.with_inner(|ctx| match oauth2::dc_get_oauth2_url(ctx, addr, redirect) {
|
||||
Some(res) => res.strdup(),
|
||||
|
||||
Reference in New Issue
Block a user