From f6ec73d37f1b8d95ae6eabd7a9d2a0fae3f9ebf4 Mon Sep 17 00:00:00 2001 From: "Frank M. Kromann" Date: Tue, 19 Mar 2002 23:00:17 +0000 Subject: Minor change to allocated lengths for dates --- ext/mssql/php_mssql.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'ext/mssql/php_mssql.c') 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); } -- cgit v1.2.1