From 84a3bf6b395d170feda1a09bb26c29b27ec46fe9 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 6 Nov 2016 21:28:32 +0000 Subject: [PATCH] Fix CS in gnupg_deletekey --- gnupg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnupg.c b/gnupg.c index 10254ad..a126a0a 100644 --- a/gnupg.c +++ b/gnupg.c @@ -1648,21 +1648,23 @@ PHP_FUNCTION(gnupg_deletekey) GNUPG_GETOBJ(); if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &key, &key_len, &allow_secret) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", + &key, &key_len, &allow_secret) == FAILURE) { return; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &key, &key_len, &allow_secret) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", + &res, &key, &key_len, &allow_secret) == FAILURE) { return; } GNUPG_RES_FETCH(); } - if ((PHPC_THIS->err = gpgme_get_key(PHPC_THIS->ctx, key, &gpgme_key, 0)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_get_key(PHPC_THIS->ctx, key, &gpgme_key, 0))) { GNUPG_ERR("get_key failed"); return; } - if ((PHPC_THIS->err = gpgme_op_delete(PHPC_THIS->ctx,gpgme_key,allow_secret)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_op_delete(PHPC_THIS->ctx,gpgme_key,allow_secret))) { GNUPG_ERR("delete failed"); RETVAL_FALSE; } else {