From a7d635afb702594870559d54453ea7b5dcaa760a Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 12 Dec 2025 22:24:13 -0800 Subject: xpass: voidify `get_options()` This function always returned `true`; removing the return type revealed some impossible code for handling `false` that could also be removed. --- xpass.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/xpass.c b/xpass.c index b37863e..87eb586 100644 --- a/xpass.c +++ b/xpass.c @@ -62,17 +62,16 @@ PHP_MINFO_FUNCTION(xpass) } /* }}} */ -static bool get_options(zend_array *options, zend_ulong *cost) { +static void get_options(zend_array *options, zend_ulong *cost) { zval *opt; *cost = 0; if (!options) { - return true; + return; } if ((opt = zend_hash_str_find(options, "cost", strlen("cost")))) { *cost = zval_get_long(opt); } - return true; } @@ -82,9 +81,7 @@ static zend_string *php_xpass_hash(const zend_string *password, zend_array *opti memset(&data, 0, sizeof(data)); - if (!get_options(options, &cost)) { - return NULL; - } + get_options(options, &cost); if ((ZSTR_LEN(password) >= CRYPT_MAX_PASSPHRASE_SIZE)) { zend_value_error("Password is too long"); return NULL; -- cgit