mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
refactor: reduce dependencies on libc
This commit is contained in:
committed by
GitHub
parent
39b82c2607
commit
4e41dbf5ab
@@ -160,12 +160,12 @@ pub unsafe fn dc_param_get_int(
|
||||
if param.is_null() || key == 0i32 {
|
||||
return def;
|
||||
}
|
||||
let str: *mut libc::c_char = dc_param_get(param, key, 0 as *const libc::c_char);
|
||||
if str.is_null() {
|
||||
let s = dc_param_get(param, key, 0 as *const libc::c_char);
|
||||
if s.is_null() {
|
||||
return def;
|
||||
}
|
||||
let ret: int32_t = as_str(str).parse().unwrap_or_default();
|
||||
free(str as *mut libc::c_void);
|
||||
let ret = as_str(s).parse().unwrap_or_default();
|
||||
free(s as *mut libc::c_void);
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user