mirror of
https://github.com/php/php-src.git
synced 2024-11-30 05:13:56 +08:00
- Fix INT8 returning garbage because ifx_int8toasc does not null_terminate
the returned string. (danny)
This commit is contained in:
parent
db0872123b
commit
d140a799f7
@ -2110,7 +2110,11 @@ $ifdef HAVE_IFX_IUS;
|
||||
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 @@ $ifdef HAVE_IFX_IUS;
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user