From 5966fefb9a291bd0eecd0fff9396b2b6cea4a62e Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 7 Dec 2022 20:37:25 +0100 Subject: Minor refactor --- src/sp_unserialize.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/sp_unserialize.c') diff --git a/src/sp_unserialize.c b/src/sp_unserialize.c index 64cf1b5..e57ef9c 100644 --- a/src/sp_unserialize.c +++ b/src/sp_unserialize.c @@ -90,14 +90,15 @@ PHP_FUNCTION(sp_unserialize) { char *serialized_str = NULL; char *hmac = NULL; size_t buf_len = 0; - zval *opts = NULL; + HashTable *opts = NULL; const sp_config_unserialize *config_unserialize = &(SPCFG(unserialize)); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &opts) == - FAILURE) { - RETURN_FALSE; - } + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STRING(buf, buf_len) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY_HT(opts) + ZEND_PARSE_PARAMETERS_END(); /* 64 is the length of HMAC-256 */ if (buf_len < 64) { -- cgit v1.3