com php-src: Fixed Hash API usage: ext/pdo/pdo_sql_parser .c

From: Date: Sun, 18 May 2014 12:23:26 +0000
Subject: com php-src: Fixed Hash API usage: ext/pdo/pdo_sql_parser .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78442@lists.php.net to get a copy of this message
Commit: af3829608d06c96f61b8ed55c95f42f1fdc75d7c Author: Xinchen Hui <laruence@gmail.com> Sun, 18 May 2014 20:23:26 +0800 Parents: 4ababc3a41e6e68ee0b57ab212ce943900bb6685 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=af3829608d06c96f61b8ed55c95f42f1fdc75d7c Log: Fixed Hash API usage Changed paths: M ext/pdo/pdo_sql_parser.c Diff: diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index cf10899..77965ae 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -780,8 +780,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char padding = 3; } if(params) { + HashPosition *param_pos; zend_hash_internal_pointer_reset(params); - while (SUCCESS == zend_hash_get_current_data(params, (void**)&param)) { + while ((param == zend_hash_get_current_data_ptr_ex(params, &param_pos)) != NULL) { if(param->parameter) { convert_to_string(param->parameter); /* accommodate a string that needs to be fully quoted @@ -813,9 +814,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char } /* lookup bind first via hash and then index */ /* stupid keys need to be null-terminated, even though we know their length */ - if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)&param)) + if((NULL != (param = zend_hash_str_find_ptr(params, s.tok, s.cur-s.tok)) || - (SUCCESS == zend_hash_index_find(params, bindno, (void **)&param))) + NULL != (params = zend_hash_index_find_ptr(params, bindno))) { char *quotedstr; int quotedstrlen; @@ -852,7 +853,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char return (int) (s.cur - inquery); } /* lookup bind by index */ - if(SUCCESS == zend_hash_index_find(params, bindno, (void **)&param)) + if(NULL != zend_hash_index_find(params, bindno, (void **)&param)) { char *quotedstr; int quotedstrlen;

« previous php.cvs (#78442) next »