mirror of
https://github.com/chatmail/core.git
synced 2026-05-15 12:56:30 +03:00
Update docs and fix string allocation
The docs say you should always unref the string and NULL is never returned. The implementation should follow that.
This commit is contained in:
@@ -4171,7 +4171,7 @@ pub unsafe extern "C" fn dc_backup_provider_get_qr(
|
||||
) -> *mut libc::c_char {
|
||||
if provider.is_null() {
|
||||
eprintln!("ignoring careless call to dc_backup_provider_qr");
|
||||
return ptr::null_mut();
|
||||
return "".strdup();
|
||||
}
|
||||
let ffi_provider = &*provider;
|
||||
deltachat::qr::format_backup(&ffi_provider.provider.qr())
|
||||
@@ -4185,7 +4185,7 @@ pub unsafe extern "C" fn dc_backup_provider_get_qr_svg(
|
||||
) -> *mut libc::c_char {
|
||||
if provider.is_null() {
|
||||
eprintln!("ignoring careless call to dc_backup_provider_qr_svg()");
|
||||
return ptr::null_mut();
|
||||
return "".strdup();
|
||||
}
|
||||
let ffi_provider = &*provider;
|
||||
let ctx = &*ffi_provider.context;
|
||||
|
||||
Reference in New Issue
Block a user