Make dc_open arguments rusty

This commit is contained in:
Alexander Krotov
2019-07-29 03:04:59 +03:00
parent c34e66adb6
commit 2d5b04148f
8 changed files with 41 additions and 62 deletions

View File

@@ -399,12 +399,7 @@ fn main_0(args: Vec<String>) -> Result<(), failure::Error> {
unsafe { dc_cmdline_skip_auth() };
if args.len() == 2 {
if 0 == unsafe {
let a = to_cstring(&args[1]);
let res = dc_open(&mut context, a, 0 as *const _);
free(a as *mut _);
res
} {
if unsafe { !dc_open(&mut context, &args[1], None) } {
println!("Error: Cannot open {}.", args[0],);
}
} else if args.len() != 1 {