diff options
| author | Daniel Scherzer <daniel.e.scherzer@gmail.com> | 2025-12-12 22:24:13 -0800 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2025-12-13 08:07:31 +0100 |
| commit | a7d635afb702594870559d54453ea7b5dcaa760a (patch) | |
| tree | 421a53e297702aed65757923fae336490b8723fd | |
| parent | 7a080d859439810e7b0e704ad47fc7d021cf0db3 (diff) | |
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.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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; |
