summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Scherzer <daniel.e.scherzer@gmail.com>2025-12-12 22:24:13 -0800
committerRemi Collet <remi@php.net>2025-12-13 08:07:31 +0100
commita7d635afb702594870559d54453ea7b5dcaa760a (patch)
tree421a53e297702aed65757923fae336490b8723fd
parent7a080d859439810e7b0e704ad47fc7d021cf0db3 (diff)
xpass: voidify `get_options()`HEADmaster
This function always returned `true`; removing the return type revealed some impossible code for handling `false` that could also be removed.
-rw-r--r--xpass.c9
1 files 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;