com php-src: Use API instead of directly acessing the structure: ext/mysqli/mysqli_prop.c
| From: | Andrey Hristov | Date: | Tue, 25 Feb 2014 15:39:06 +0000 |
| Subject: | com php-src: Use API instead of directly acessing the structure: ext/mysqli/mysqli_prop.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76200@lists.php.net to get a copy of this message | ||
Commit: aad7b724721c01f6269951511ee4c92843f56e0c
Author: Andrey Hristov <andrey@php.net> Tue, 25 Feb 2014 17:39:06 +0200
Parents: 60ed3f78bdab82b21c67b12ecd31ff7fd710e4f2
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aad7b724721c01f6269951511ee4c92843f56e0c
Log:
Use API instead of directly acessing the structure
Changed paths:
M ext/mysqli/mysqli_prop.c
Diff:
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 7060367..2d36336 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -311,19 +311,21 @@ static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
MYSQL_RES *p;
ulong *ret;
+ uint field_count;
MAKE_STD_ZVAL(*retval);
CHECK_STATUS(MYSQLI_STATUS_VALID);
p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
- if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) {
+ field_count = mysql_num_fields(p);
+ if (!p || !field_count || !(ret = mysql_fetch_lengths(p))) {
ZVAL_NULL(*retval);
} else {
ulong i;
array_init(*retval);
- for (i = 0; i < p->field_count; i++) {
+ for (i = 0; i < field_count; i++) {
add_index_long(*retval, i, ret[i]);
}
}