summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-12-10 17:35:35 +0800
committerXinchen Hui <laruence@gmail.com>2015-12-10 17:35:35 +0800
commite4ad9ed8adac91ad62c8245615e5d74e35944dff (patch)
treee0c9559fcb05b39ce09d76d22b75bc068afc0036
parente2e39f3bfc67a70d58f82fc720e8746c32775c85 (diff)
downloadphp-git-e4ad9ed8adac91ad62c8245615e5d74e35944dff.tar.gz
Return -1 seems bug here
-rw-r--r--ext/dba/dba.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 02413337a4..6dd3e6d499 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -209,7 +209,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
if (zend_hash_num_elements(Z_ARRVAL_P(key)) != 2) {
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
- return -1;
+ return 0;
}
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &pos);
group = zend_hash_get_current_data_ex(Z_ARRVAL_P(key), &pos);
@@ -233,7 +233,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
convert_to_string(&tmp);
len = Z_STRLEN(tmp);
- if (Z_STRLEN(tmp)) {
+ if (len) {
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
}
zval_ptr_dtor(&tmp);