Apply requested changes

This commit is contained in:
jikstra
2019-12-04 01:16:16 +01:00
committed by holger krekel
parent e38b42bc21
commit a7e1b4653e

View File

@@ -2383,8 +2383,8 @@ pub unsafe extern "C" fn dc_chat_get_info_json(
chat_id: u32, chat_id: u32,
) -> *mut libc::c_char { ) -> *mut libc::c_char {
if context.is_null() { if context.is_null() {
eprintln!("ignoring careless call to dc_get_oauth2_url()"); eprintln!("ignoring careless call to dc_chat_get_info_json()");
return ptr::null_mut(); // NULL explicitly defined as "unknown" return ptr::null_mut(); // NULL explicitly defined as "error"
} }
let ffi_context = &*context; let ffi_context = &*context;
ffi_context ffi_context
@@ -2392,7 +2392,7 @@ pub unsafe extern "C" fn dc_chat_get_info_json(
Ok(s) => s.strdup(), Ok(s) => s.strdup(),
Err(err) => { Err(err) => {
error!(ctx, "get_info_json({}) returned: {}", chat_id, err); error!(ctx, "get_info_json({}) returned: {}", chat_id, err);
"".strdup() return ptr::null_mut();
} }
}) })
.unwrap_or_else(|_| ptr::null_mut()) .unwrap_or_else(|_| ptr::null_mut())