summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjvoisin2022-12-07 20:37:25 +0100
committerjvoisin2022-12-07 20:37:25 +0100
commit5966fefb9a291bd0eecd0fff9396b2b6cea4a62e (patch)
tree26d69eac3b3b9587a5e360f519743f80c5b5b4bc /src
parent3134f49d4de12d1e2507272e0e5022bdf5d60093 (diff)
Minor refactor
Diffstat (limited to 'src')
-rw-r--r--src/sp_unserialize.c11
1 files changed, 6 insertions, 5 deletions
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) {
90 char *serialized_str = NULL; 90 char *serialized_str = NULL;
91 char *hmac = NULL; 91 char *hmac = NULL;
92 size_t buf_len = 0; 92 size_t buf_len = 0;
93 zval *opts = NULL; 93 HashTable *opts = NULL;
94 94
95 const sp_config_unserialize *config_unserialize = &(SPCFG(unserialize)); 95 const sp_config_unserialize *config_unserialize = &(SPCFG(unserialize));
96 96
97 if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &opts) == 97 ZEND_PARSE_PARAMETERS_START(1, 2)
98 FAILURE) { 98 Z_PARAM_STRING(buf, buf_len)
99 RETURN_FALSE; 99 Z_PARAM_OPTIONAL
100 } 100 Z_PARAM_ARRAY_HT(opts)
101 ZEND_PARSE_PARAMETERS_END();
101 102
102 /* 64 is the length of HMAC-256 */ 103 /* 64 is the length of HMAC-256 */
103 if (buf_len < 64) { 104 if (buf_len < 64) {