mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 06:46:35 +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 {
|
if param.is_null() || key == 0i32 {
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
let str: *mut libc::c_char = dc_param_get(param, key, 0 as *const libc::c_char);
|
let s = dc_param_get(param, key, 0 as *const libc::c_char);
|
||||||
if str.is_null() {
|
if s.is_null() {
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
let ret: int32_t = as_str(str).parse().unwrap_or_default();
|
let ret = as_str(s).parse().unwrap_or_default();
|
||||||
free(str as *mut libc::c_void);
|
free(s as *mut libc::c_void);
|
||||||
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user