From 1d300dddfe4722c5063d2c0d16583ecc8420599c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 3 Sep 2015 14:00:03 +0200 Subject: [PATCH] 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. --- ChangeLog.txt | 5 +++++ src/rdd/sdf1.c | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8d6e5386c2..ba7e363de9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,11 @@ * 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) * ChangeLog.txt ! typos in prev ChgLog entry diff --git a/src/rdd/sdf1.c b/src/rdd/sdf1.c index a656faf740..277af96693 100644 --- a/src/rdd/sdf1.c +++ b/src/rdd/sdf1.c @@ -97,14 +97,13 @@ static void hb_sdfClearRecordBuffer( SDFAREAP pArea ) static HB_ERRCODE hb_sdfReadRecord( SDFAREAP pArea ) { HB_USHORT uiRead, uiToRead, uiEolPos; - HB_SIZE nRead; HB_TRACE( HB_TR_DEBUG, ( "hb_sdfReadRecord(%p)", pArea ) ); uiToRead = pArea->uiRecordLen + pArea->uiEolLen + 2; - nRead = hb_fileReadAt( pArea->pFile, pArea->pRecord, uiToRead, - pArea->nRecordOffset ); - uiRead = ( HB_USHORT ) ( nRead == ( HB_SIZE ) FS_ERROR ? 0 : nRead ); + uiRead = ( HB_USHORT ) hb_fileResult( + hb_fileReadAt( pArea->pFile, pArea->pRecord, uiToRead, + pArea->nRecordOffset ) ); if( uiRead > 0 && uiRead < uiToRead && pArea->pRecord[ uiRead - 1 ] == '\032' ) --uiRead; @@ -168,9 +167,9 @@ static HB_ERRCODE hb_sdfNextRecord( SDFAREAP pArea ) do { - HB_SIZE nRead = hb_fileReadAt( pArea->pFile, pArea->pRecord + uiRest, - uiToRead - uiRest, ulOffset + uiRest ) + uiRest; - uiRead = ( HB_USHORT ) ( nRead == ( HB_SIZE ) FS_ERROR ? 0 : nRead ); + uiRead = ( HB_USHORT ) hb_fileResult( + hb_fileReadAt( pArea->pFile, pArea->pRecord + uiRest, + uiToRead - uiRest, ulOffset + uiRest ) ) + uiRest; if( uiRead > 0 && uiRead < uiToRead && pArea->pRecord[ uiRead - 1 ] == '\032' ) --uiRead;