From: Anthony Ferrara Date: Mon, 17 Sep 2012 15:43:47 +0000 (-0400) Subject: Refactor slightly to enable cleaner readability X-Git-Tag: php-5.5.0alpha1~18^2~17^2~2^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bd79d180716fc521a3f5cae4bbfa96eb6397925;p=php Refactor slightly to enable cleaner readability --- diff --git a/ext/standard/password.c b/ext/standard/password.c index 8e9d8941b5..e8762690bb 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -242,16 +242,16 @@ PHP_FUNCTION(password_needs_rehash) switch (algo) { case PHP_PASSWORD_BCRYPT: { - int newCost = PHP_PASSWORD_BCRYPT_COST, cost = 0; + long new_cost = PHP_PASSWORD_BCRYPT_COST, cost = 0; - if (options && zend_symtable_find(options, "cost", 5, (void **) &option_buffer) == SUCCESS) { + if (options && zend_symtable_find(options, "cost", sizeof("cost"), (void **) &option_buffer) == SUCCESS) { convert_to_long_ex(option_buffer); - newCost = Z_LVAL_PP(option_buffer); + new_cost = Z_LVAL_PP(option_buffer); zval_ptr_dtor(option_buffer); } - sscanf(hash, "$2y$%d$", &cost); - if (cost != newCost) { + sscanf(hash, "$2y$%ld$", &cost); + if (cost != new_cost) { RETURN_TRUE; } }