From 38a295bf638997e489e78bcfdbefda22658dcb76 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 13 Feb 2010 21:42:06 +0000 Subject: [PATCH] 2010-02-13 22:41 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/hbdyn.c ! Fixed to honor length when returning HB_DYN_CTYPE_CHAR_UNSIGNED_PTR by reference. --- harbour/ChangeLog | 5 +++++ harbour/contrib/hbwin/hbdyn.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 84c8b6eb70..f76adb972d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-13 22:41 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/hbdyn.c + ! Fixed to honor length when returning HB_DYN_CTYPE_CHAR_UNSIGNED_PTR + by reference. + 2010-02-13 20:52 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/hbdyn.h * contrib/hbwin/hbdyn.ch diff --git a/harbour/contrib/hbwin/hbdyn.c b/harbour/contrib/hbwin/hbdyn.c index 029c1f027f..6723818d82 100644 --- a/harbour/contrib/hbwin/hbdyn.c +++ b/harbour/contrib/hbwin/hbdyn.c @@ -254,7 +254,10 @@ static PHB_ITEM hb_u64ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_U64 n break; case HB_DYN_CTYPE_CHAR_UNSIGNED_PTR: - hb_itemPutC( pItem, ( const char * ) nRetVal ); + if( nLen == -1 ) + hb_itemPutC( pItem, ( const char * ) nRetVal ); + else + hb_itemPutCL( pItem, ( const char * ) nRetVal, nLen ); break; case HB_DYN_CTYPE_CHAR_PTR: @@ -513,7 +516,10 @@ static PHB_ITEM hb_u32ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA break; case HB_DYN_CTYPE_CHAR_UNSIGNED_PTR: - hb_itemPutC( pItem, ( const char * ) value.t.n32 ); + if( nLen == -1 ) + hb_itemPutC( pItem, ( const char * ) value.t.n32 ); + else + hb_itemPutCL( pItem, ( const char * ) value.t.n32, nLen ); break; case HB_DYN_CTYPE_CHAR_PTR: