summaryrefslogtreecommitdiff
path: root/ext/mssql/php_mssql.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-09-28 14:09:01 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-09-28 14:09:01 +0000
commit545e42675d05f903c81b31963f5cef5dbb26e226 (patch)
treee9f9b61c8eedd0d35602a13060b8588eaf6d1503 /ext/mssql/php_mssql.c
parent70e1858a929058c3392ce5f518dcfd8646cd53ba (diff)
downloadphp-git-545e42675d05f903c81b31963f5cef5dbb26e226.tar.gz
MFH: Fixed bug #30224 (Sybase date strings are sometimes not null
terminated).
Diffstat (limited to 'ext/mssql/php_mssql.c')
-rw-r--r--ext/mssql/php_mssql.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 489c655328..4b82b5d41c 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -866,6 +866,7 @@ 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);
+ res_buf[res_length] = '\0';
} else {
if (column_type == SQLDATETIM4) {
DBDATETIME temp;
@@ -939,7 +940,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
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);
-
+ res_buf[res_length] = '\0';
} else {
if (column_type == SQLDATETIM4) {
DBDATETIME temp;