tony2001 Wed Mar 28 23:05:36 2007 UTC
Modified files:
/php-src/ext/oci8 oci8_collection.c
Log:
Oracle seems to return non zero terminated strings or strings with only 1
zero at the end in Unicode mode
surely u_strlen() doesn't like it, so lets use OCIStringSize() and avoid
u_strlen()
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_collection.c?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/oci8/oci8_collection.c
diff -u php-src/ext/oci8/oci8_collection.c:1.12
php-src/ext/oci8/oci8_collection.c:1.13
--- php-src/ext/oci8/oci8_collection.c:1.12 Mon Jan 1 09:29:26 2007
+++ php-src/ext/oci8/oci8_collection.c Wed Mar 28 23:05:36 2007
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_collection.c,v 1.12 2007/01/01 09:29:26 sebastian Exp $ */
+/* $Id: oci8_collection.c,v 1.13 2007/03/28 23:05:36 tony2001 Exp $ */
@@ -503,14 +503,17 @@
{
OCIString *oci_string = *(OCIString **)element;
text *str;
+ ub4 str_len;
PHP_OCI_CALL_RETURN(str, OCIStringPtr,
(connection->env, oci_string));
if (str) {
+ PHP_OCI_CALL_RETURN(str_len, OCIStringSize,
(connection->env, oci_string));
+
if (UG(unicode)) {
- ZVAL_UNICODE(*result_element, (UChar
*)str, 1);
+ ZVAL_UNICODEL(*result_element, (UChar
*)str, TEXT_CHARS(str_len), 1);
} else {
- ZVAL_STRING(*result_element, str, 1);
+ ZVAL_STRINGL(*result_element, str,
str_len, 1);
}
}
return 0;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php