summaryrefslogtreecommitdiff
path: root/ext/mssql/php_mssql.c
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2002-03-19 23:00:17 +0000
committerFrank M. Kromann <fmk@php.net>2002-03-19 23:00:17 +0000
commitf6ec73d37f1b8d95ae6eabd7a9d2a0fae3f9ebf4 (patch)
tree543068bf44c302aa45485c44037ebaa8d088f573 /ext/mssql/php_mssql.c
parent1822154a4c0bb8e94e705d5f108a02f8e9c2c808 (diff)
downloadphp-git-f6ec73d37f1b8d95ae6eabd7a9d2a0fae3f9ebf4.tar.gz
Minor change to allocated lengths for dates
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);
}