cvs: php4 /ext/informix ifx.ec
| From: | Danny Heijl | Date: | Sat, 05 Aug 2000 13:14:42 +0000 |
| Subject: | cvs: php4 /ext/informix ifx.ec | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1049@lists.php.net to get a copy of this message | ||
danny Sat Aug 5 06:14:42 2000 EDT
Modified files:
/php4/ext/informix ifx.ec
Log:
- Fix INT8 returning garbage because ifx_int8toasc does not null_terminate
the returned string. (danny)
Index: php4/ext/informix/ifx.ec
diff -u php4/ext/informix/ifx.ec:1.43 php4/ext/informix/ifx.ec:1.44
--- php4/ext/informix/ifx.ec:1.43 Sun Jul 23 22:40:59 2000
+++ php4/ext/informix/ifx.ec Sat Aug 5 06:14:42 2000
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ifx.ec,v 1.43 2000/07/24 05:40:59 david Exp $ */
+/* $Id: ifx.ec,v 1.44 2000/08/05 13:14:42 danny Exp $ */
/* -------------------------------------------------------------------
* if you want a function reference : "grep '^\*\*' ifx.ec" will give
@@ -2110,7 +2110,11 @@
case SQLSERIAL8 :
case SQLINT8 :
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA;
+ memset(string_data, ' ', sizeof(string_data));
ifx_int8toasc(&int8_var,string_data,200);
+ p = string_data; /* rtrim string_data */
+ while ((*p != ' ') && (p <
&string_data[sizeof(string_data) - 1])) ++p;
+ *p = 0;
add_assoc_string(return_value, fieldname, string_data, DUP);
break;
case SQLLVARCHAR:
@@ -2485,7 +2489,11 @@
case SQLSERIAL8:
case SQLINT8 :
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA;
+ memset(string_data, ' ', sizeof(string_data));
ifx_int8toasc(&int8_var,string_data,200);
+ p = string_data; /* rtrim string_data */
+ while ((*p != ' ') && (p <
&string_data[sizeof(string_data) - 1])) ++p;
+ *p = 0;
php_printf("<td>%s</td>", string_data);
break;
case SQLLVARCHAR: