From 11ba584ff8ab08f6d0bd21bef5e03aa42650e579 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 9 Oct 2016 19:54:03 +0100 Subject: [PATCH] Fix CS in gnupg_sign --- gnupg.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gnupg.c b/gnupg.c index a21ed58..b7f0e40 100644 --- a/gnupg.c +++ b/gnupg.c @@ -1107,27 +1107,29 @@ PHP_FUNCTION(gnupg_sign) GNUPG_GETOBJ(); if (this) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + &value, &value_len) == FAILURE) { return; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &res, &value, &value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", + &res, &value, &value_len) == FAILURE) { return; } GNUPG_RES_FETCH(); } gpgme_set_passphrase_cb(PHPC_THIS->ctx, passphrase_cb, PHPC_THIS); - if ((PHPC_THIS->err = gpgme_data_new_from_mem(&in, value, value_len, 0)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_data_new_from_mem(&in, value, value_len, 0))) { GNUPG_ERR("could not create in-data buffer"); return; } - if ((PHPC_THIS->err = gpgme_data_new(&out)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_data_new(&out))) { GNUPG_ERR("could not create out-data buffer"); gpgme_data_release(in); return; } - if ((PHPC_THIS->err = gpgme_op_sign(PHPC_THIS->ctx, in, out, PHPC_THIS->signmode)) != GPG_ERR_NO_ERROR) { + if (!PHP_GNUPG_DO(gpgme_op_sign(PHPC_THIS->ctx, in, out, PHPC_THIS->signmode))) { if (!PHPC_THIS->errortxt) { GNUPG_ERR("data signing failed"); }