2015-09-03 14:00 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/rdd/sdf1.c
    ! use hb_fileResult() to process hb_fileRead() results - it fixes
      problem reported by Viktor.
This commit is contained in:
Przemysław Czerpak
2015-09-03 14:00:03 +02:00
parent 8c5c40d8b5
commit 1d300dddfe
2 changed files with 11 additions and 7 deletions

View File

@@ -10,6 +10,11 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/ */
2015-09-03 14:00 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rdd/sdf1.c
! use hb_fileResult() to process hb_fileRead() results - it fixes
problem reported by Viktor.
2015-09-02 22:53 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) 2015-09-02 22:53 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* ChangeLog.txt * ChangeLog.txt
! typos in prev ChgLog entry ! typos in prev ChgLog entry

View File

@@ -97,14 +97,13 @@ static void hb_sdfClearRecordBuffer( SDFAREAP pArea )
static HB_ERRCODE hb_sdfReadRecord( SDFAREAP pArea ) static HB_ERRCODE hb_sdfReadRecord( SDFAREAP pArea )
{ {
HB_USHORT uiRead, uiToRead, uiEolPos; HB_USHORT uiRead, uiToRead, uiEolPos;
HB_SIZE nRead;
HB_TRACE( HB_TR_DEBUG, ( "hb_sdfReadRecord(%p)", pArea ) ); HB_TRACE( HB_TR_DEBUG, ( "hb_sdfReadRecord(%p)", pArea ) );
uiToRead = pArea->uiRecordLen + pArea->uiEolLen + 2; uiToRead = pArea->uiRecordLen + pArea->uiEolLen + 2;
nRead = hb_fileReadAt( pArea->pFile, pArea->pRecord, uiToRead, uiRead = ( HB_USHORT ) hb_fileResult(
pArea->nRecordOffset ); hb_fileReadAt( pArea->pFile, pArea->pRecord, uiToRead,
uiRead = ( HB_USHORT ) ( nRead == ( HB_SIZE ) FS_ERROR ? 0 : nRead ); pArea->nRecordOffset ) );
if( uiRead > 0 && uiRead < uiToRead && pArea->pRecord[ uiRead - 1 ] == '\032' ) if( uiRead > 0 && uiRead < uiToRead && pArea->pRecord[ uiRead - 1 ] == '\032' )
--uiRead; --uiRead;
@@ -168,9 +167,9 @@ static HB_ERRCODE hb_sdfNextRecord( SDFAREAP pArea )
do do
{ {
HB_SIZE nRead = hb_fileReadAt( pArea->pFile, pArea->pRecord + uiRest, uiRead = ( HB_USHORT ) hb_fileResult(
uiToRead - uiRest, ulOffset + uiRest ) + uiRest; hb_fileReadAt( pArea->pFile, pArea->pRecord + uiRest,
uiRead = ( HB_USHORT ) ( nRead == ( HB_SIZE ) FS_ERROR ? 0 : nRead ); uiToRead - uiRest, ulOffset + uiRest ) ) + uiRest;
if( uiRead > 0 && uiRead < uiToRead && if( uiRead > 0 && uiRead < uiToRead &&
pArea->pRecord[ uiRead - 1 ] == '\032' ) pArea->pRecord[ uiRead - 1 ] == '\032' )
--uiRead; --uiRead;