summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib/dblib_stmt.c
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2010-06-22 02:09:57 (GMT)
committerStanley Sufficool <ssufficool@php.net>2010-06-22 02:09:57 (GMT)
commitc8b7f939e667e81347275162a3402a5ef149e5b5 (patch)
treed96ce383bd3f101acd2df06bd542b83e6f2a4c71 /ext/pdo_dblib/dblib_stmt.c
parentbaf72b73365145fc4fd6393217c2df2229b6a8b1 (diff)
downloadphp-c8b7f939e667e81347275162a3402a5ef149e5b5.tar.gz
Fix bug #52134
Diffstat (limited to 'ext/pdo_dblib/dblib_stmt.c')
-rw-r--r--ext/pdo_dblib/dblib_stmt.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index be57928..4d2d165 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -236,7 +236,7 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
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 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
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;