From 39320786aa486c5a609d3237b1d76ae29418b133 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Mar 2010 23:47:23 +0000 Subject: [PATCH] 2010-03-02 00:45 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/rddsql/sddodbc/sddodbc.c ! Fixed returning Chr( 0 ) instead of last real char. --- harbour/ChangeLog | 4 ++++ harbour/contrib/rddsql/sddodbc/sddodbc.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a9f96a1b9c..299231150b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,10 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-02 00:45 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/rddsql/sddodbc/sddodbc.c + ! Fixed returning Chr( 0 ) instead of last real char. + 2010-03-01 14:45 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/rddsql/sddodbc/sddodbc.c + Added support to return any size of string buffer from ODBC. diff --git a/harbour/contrib/rddsql/sddodbc/sddodbc.c b/harbour/contrib/rddsql/sddodbc/sddodbc.c index eddbc45742..5a5f48b67c 100644 --- a/harbour/contrib/rddsql/sddodbc/sddodbc.c +++ b/harbour/contrib/rddsql/sddodbc/sddodbc.c @@ -594,8 +594,8 @@ static HB_ERRCODE odbcGoTo( SQLBASEAREAP pArea, HB_ULONG ulRecNo ) { if( iLen > 0 ) { - SQLPOINTER * val = ( SQLPOINTER * ) hb_xgrab( iLen ); - if( SQL_SUCCEEDED( res = SQLGetData( hStmt, ui, iTargetType, val, iLen, &iLen ) ) ) + SQLPOINTER * val = ( SQLPOINTER * ) hb_xgrab( iLen + sizeof( O_HB_CHAR ) ); + if( SQL_SUCCEEDED( res = SQLGetData( hStmt, ui, iTargetType, val, iLen + sizeof( O_HB_CHAR ), &iLen ) ) ) { #if defined( UNICODE ) iLen /= 2;