diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-10 14:37:20 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-10 14:37:20 +0100 |
commit | 52971cdf2b2fcba653a908186c4db36da06cef8b (patch) | |
tree | 7390743d91912c210ef4c4925ccfb976ca54462b | |
parent | 9699b4c705b1291ca8b4f2ec06b4d2f1a2949c10 (diff) |
ffi: Fix reason for revocation parameter handling.
- We must use &c_char here instead of *const c_char, because the
former can not be NULL, hence Option<&c_char> gets
NULLable-pointer-optimized (see
https://doc.rust-lang.org/nomicon/ffi.html#the-nullable-pointer-optimization).
-rw-r--r-- | ffi/src/openpgp/tpk.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ffi/src/openpgp/tpk.rs b/ffi/src/openpgp/tpk.rs index 379a1a2d..32166a5f 100644 --- a/ffi/src/openpgp/tpk.rs +++ b/ffi/src/openpgp/tpk.rs @@ -284,7 +284,7 @@ fn int_to_reason_for_revocation(code: c_int) -> ReasonForRevocation { pub extern "system" fn sq_tpk_revoke(ctx: *mut Context, tpk: *mut TPK, code: c_int, - reason: Option<*const c_char>) + reason: Option<&c_char>) -> *mut packet::Signature { let ctx = ffi_param_ref_mut!(ctx); @@ -340,7 +340,7 @@ pub extern "system" fn sq_tpk_revoke(ctx: *mut Context, pub extern "system" fn sq_tpk_revoke_in_place(ctx: *mut Context, tpk: *mut TPK, code: c_int, - reason: Option<*const c_char>) + reason: Option<&c_char>) -> *mut TPK { let ctx = ffi_param_ref_mut!(ctx); |