com php-src: Refactor slightly to enable cleaner readability: ext/standard/password.c
| From: | Anthony Ferrara | Date: | Mon, 17 Sep 2012 15:43:47 +0000 |
| Subject: | com php-src: Refactor slightly to enable cleaner readability: ext/standard/password.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70354@lists.php.net to get a copy of this message | ||
Commit: 8bd79d180716fc521a3f5cae4bbfa96eb6397925
Author: Anthony Ferrara <ircmaxell@gmail.com> Mon, 17 Sep 2012 11:43:47 -0400
Parents: 6fd5ba5c8d70ecbd80175a488160f57380d8afee
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8bd79d180716fc521a3f5cae4bbfa96eb6397925
Log:
Refactor slightly to enable cleaner readability
Changed paths:
M ext/standard/password.c
Diff:
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 8e9d894..e876269 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;
}
}