cvs: /php4/ext/mssql php_mssql.c
| From: | Frank M. Kromann | Date: | Thu, 20 Apr 2000 15:50:27 +0000 |
| Subject: | cvs: /php4/ext/mssql php_mssql.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13803@lists.php.net to get a copy of this message | ||
fmk Thu Apr 20 08:50:27 2000 EDT
Modified files:
/php4/ext/mssql php_mssql.c
Log:
Fixing init problem for Zval's in mssql_query
Index: php4/ext/mssql/php_mssql.c
diff -u php4/ext/mssql/php_mssql.c:1.16 php4/ext/mssql/php_mssql.c:1.17
--- php4/ext/mssql/php_mssql.c:1.16 Mon Apr 17 12:54:50 2000
+++ php4/ext/mssql/php_mssql.c Thu Apr 20 08:49:56 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mssql.c,v 1.16 2000/04/17 19:54:50 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.17 2000/04/20 15:49:56 fmk Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
@@ -831,6 +831,7 @@
}
result->data[i] = (zval *) emalloc(sizeof(zval)*num_fields);
for (j=1; j<=num_fields; j++) {
+ INIT_PZVAL(&result->data[i][j-1]);
MS_SQL_G(get_column_content(mssql_ptr, j, &result->data[i][j-1], column_types[j-1]));
}
retvalue=dbnextrow(mssql_ptr->link);
@@ -988,7 +989,7 @@
for (i=0; i<result->num_fields; i++) {
MAKE_STD_ZVAL(field_content);
*field_content = result->data[result->cur_row][i];
- zval_copy_ctor(field_content);
+ ZVAL_COPY_CTOR(field_content);
zend_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(zval *),
NULL);
}
result->cur_row++;
@@ -1021,10 +1022,9 @@
}
for (i=0; i<result->num_fields; i++) {
- ALLOC_ZVAL(tmp);
+ MAKE_STD_ZVAL(tmp);
*tmp = result->data[result->cur_row][i];
- INIT_PZVAL(tmp);
- zval_copy_ctor(tmp);
+ ZVAL_COPY_CTOR(tmp);
if (PG(magic_quotes_runtime) && tmp->type == IS_STRING) {
tmp->value.str.val = php_addslashes(tmp->value.str.val, tmp->value.str.len,
&tmp->value.str.len,1);
}
@@ -1466,7 +1466,7 @@
}
*return_value = result->data[(*row)->value.lval][field_offset];
- zval_copy_ctor(return_value);
+ ZVAL_COPY_CTOR(return_value);
}
/* }}} */