svn: /php/php-src/trunk/ext/pdo_dblib/ dblib_stmt.c
| From: | Stanley Sufficool | Date: | Tue, 22 Jun 2010 02:09:57 +0000 |
| Subject: | svn: /php/php-src/trunk/ext/pdo_dblib/ dblib_stmt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-62947@lists.php.net to get a copy of this message | ||
ssufficool Tue, 22 Jun 2010 02:09:57 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=300646
Log:
Fix bug #52134
Bug: http://bugs.php.net/52134 (Open) pdo_dblib returns 40
char strings for int
Changed paths:
U php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c
Modified: php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c
===================================================================
--- php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c 2010-06-22 00:38:47 UTC (rev 300645)
+++ php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c 2010-06-22 02:09:57 UTC (rev 300646)
@@ -236,7 +236,7 @@
case SQLMONEY4:
case SQLMONEYN: {
DBFLT8 money_value;
- dbconvert(NULL, coltype, *ptr, *len, SQLFLT8, (LPBYTE)&money_value, tmp_len);
+ dbconvert(NULL, coltype, *ptr, *len, SQLFLT8, (LPBYTE)&money_value, 8);
*len = spprintf(&tmp_ptr, 0, "%.4f", money_value);
*ptr = tmp_ptr;
break;
@@ -245,14 +245,8 @@
if (dbwillconvert(coltype, SQLCHAR)) {
tmp_len = 32 + (2 * (*len));
tmp_ptr = emalloc(tmp_len);
-
- *len = dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, tmp_len);
-
- if (*len >= 0) {
- tmp_ptr[*len] = '\0';
- }
+ *len = dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, -1);
*ptr = tmp_ptr;
- *len = tmp_len;
} else {
*len = 0;
*ptr = NULL;