From 1b3799ce6bb7e21b7aaa93a08b8c3905bbb1de11 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 13 May 2009 22:14:57 +0000 Subject: [PATCH] 2009-05-14 00:23 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/rddads/ads1.c ! added workaround for ACE bug: character fields longer then 23 bytes are increased by one byte when read by AdsGetField(). --- harbour/ChangeLog | 5 +++++ harbour/contrib/rddads/ads1.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0496dd2c61..57faceca45 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-05-14 00:23 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/rddads/ads1.c + ! added workaround for ACE bug: character fields longer then 23 bytes are + increased by one byte when read by AdsGetField(). + 2009-05-13 23:48 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/hvm.c ! fixed vary bad bug: possible complex variable corruption caused by diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index a62a46a60d..ee4a6e305a 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -2054,6 +2054,11 @@ static HB_ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) update area flags, Druzus */ hb_adsUpdateAreaFlags( pArea ); } + /* workaround for ACE bug: character fields longer then 23 bytes are + * increased by one byte when read by AdsGetField() [druzus]. + */ + if( u32Length > ( ULONG ) pField->uiLen ) + u32Length = pField->uiLen; hb_itemPutCL( pItem, ( char * ) pBuffer, u32Length ); break;