summaryrefslogtreecommitdiff
path: root/ext/mssql/php_mssql.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mssql/php_mssql.c')
-rw-r--r--ext/mssql/php_mssql.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 44fb7cd724..242b8b4a7d 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -800,7 +800,6 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
DBDATEREC dateinfo;
int res_length = dbdatlen(mssql_ptr->link,offset);
-
if ((column_type != SQLDATETIME) || MS_SQL_G(datetimeconvert)) {
if (column_type == SQLDATETIM4) res_length += 14;
@@ -808,14 +807,11 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
res_buf = (unsigned char *) emalloc(res_length + 1);
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
-
} else {
-
dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset));
- res_length = 20;
+ res_length = 19;
res_buf = (unsigned char *) emalloc(res_length + 1);
-
sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second);
}
@@ -866,12 +862,10 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
} else {
-
dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset));
- res_length = 20;
+ res_length = 19;
res_buf = (unsigned char *) emalloc(res_length + 1);
-
sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second);
}