Make dc_split_armored_data return bool (#251)

* Make dc_split_armored_data return bool

* Remove double negations
This commit is contained in:
Alexander Krotov
2019-07-30 09:46:36 +03:00
committed by Lars-Magnus Skog
parent 9314a5a8fd
commit 707c8c2830
4 changed files with 65 additions and 83 deletions

View File

@@ -1031,19 +1031,17 @@ pub unsafe fn dc_msg_get_setupcodebegin(msg: *const dc_msg_t) -> *mut libc::c_ch
|| buf.is_null()
|| buf_bytes <= 0)
{
if !(0
== dc_split_armored_data(
buf,
&mut buf_headerline,
&mut buf_setupcodebegin,
0 as *mut *const libc::c_char,
0 as *mut *const libc::c_char,
)
|| strcmp(
buf_headerline,
b"-----BEGIN PGP MESSAGE-----\x00" as *const u8 as *const libc::c_char,
) != 0i32
|| buf_setupcodebegin.is_null())
if dc_split_armored_data(
buf,
&mut buf_headerline,
&mut buf_setupcodebegin,
0 as *mut *const libc::c_char,
0 as *mut *const libc::c_char,
) && strcmp(
buf_headerline,
b"-----BEGIN PGP MESSAGE-----\x00" as *const u8 as *const libc::c_char,
) == 0
&& !buf_setupcodebegin.is_null()
{
ret = dc_strdup(buf_setupcodebegin)
}