From 67ec0b2be5ba042c2fd9cbe0161eb05a51f10c5a Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Fri, 4 Nov 2016 19:37:28 +0000 Subject: [PATCH] Fix CS in gnupg_import --- gnupg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gnupg.c b/gnupg.c index 55c7156..10254ad 100644 --- a/gnupg.c +++ b/gnupg.c @@ -1594,20 +1594,22 @@ PHP_FUNCTION(gnupg_import) GNUPG_GETOBJ(); if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &importkey, &importkey_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + &importkey, &importkey_len) == FAILURE) { return; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &res, &importkey, &importkey_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", + &res, &importkey, &importkey_len) == FAILURE) { return; } GNUPG_RES_FETCH(); } - if ((PHPC_THIS->err = gpgme_data_new_from_mem(&in, importkey, importkey_len, 0)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_data_new_from_mem(&in, importkey, importkey_len, 0))) { GNUPG_ERR("could not create in-data buffer"); return; } - if ((PHPC_THIS->err = gpgme_op_import(PHPC_THIS->ctx,in)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_op_import(PHPC_THIS->ctx,in))) { GNUPG_ERR("import failed"); gpgme_data_release(in); return;