Skip to content

Commit

Permalink
Issue #1367
Browse files Browse the repository at this point in the history
Use `zval_get_long` instead of `Z_STRVAL_P` + `atof` for parsing
timeout and read_timeout params.
  • Loading branch information
yatsukhnenko committed Jul 29, 2018
1 parent 0858f08 commit 7171ace
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redis_session.c
Expand Up @@ -469,10 +469,10 @@ PS_OPEN_FUNC(redis)
weight = zval_get_long(param);
}
if ((param = zend_hash_str_find(Z_ARRVAL(params), "timeout", sizeof("timeout") - 1)) != NULL) {
timeout = atof(Z_STRVAL_P(param));
timeout = zval_get_double(param);
}
if ((param = zend_hash_str_find(Z_ARRVAL(params), "read_timeout", sizeof("read_timeout") - 1)) != NULL) {
read_timeout = atof(Z_STRVAL_P(param));
read_timeout = zval_get_double(param);
}
if ((param = zend_hash_str_find(Z_ARRVAL(params), "persistent", sizeof("persistent") - 1)) != NULL) {
persistent = (atol(Z_STRVAL_P(param)) == 1 ? 1 : 0);
Expand Down

0 comments on commit 7171ace

Please sign in to comment.