mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 02:16:29 +03:00
Fix closure in dc_securejoin, make sure we return an empty string and
never null, make dc_get_securejoin_qr return an Option<String> and move the logic to cast it to c_str into the ffi
This commit is contained in:
@@ -1320,12 +1320,11 @@ pub unsafe extern "C" fn dc_get_securejoin_qr(
|
||||
) -> *mut libc::c_char {
|
||||
if context.is_null() {
|
||||
eprintln!("ignoring careless call to dc_get_securejoin_qr()");
|
||||
return dc_strdup(ptr::null());
|
||||
"".strdup()
|
||||
}
|
||||
|
||||
let context = &*context;
|
||||
|
||||
dc_securejoin::dc_get_securejoin_qr(context, chat_id)
|
||||
dc_securejoin::dc_get_securejoin_qr(context, chat_id).unwrap_or("").strdup()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user