fixed bug in ordercreate that corrupted the dbf

This commit is contained in:
Horacio Dario Roldan Kasimatis
2000-10-11 16:39:40 +00:00
parent 3ab2725de0
commit eeb4b2fb29

View File

@@ -3746,10 +3746,12 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pAreaCdx, LPDBORDERCREATEINFO pOrderI
pFileName = hb_fsFNameSplit( pAreaCdx->szDataFileName );
hb_strncpyUpper( szFileName, pFileName->szName, CDX_MAXTAGNAMELEN );
hb_xfree( pFileName );
hb_fsSeek( pAreaCdx->hDataFile, 0, FS_SET );
if( strcmp( szFileName, szTagName ) == 0 && hb_fsRead( pAreaCdx->hDataFile,
( BYTE * ) &pHeader, sizeof( DBFHEADER ) ) == sizeof( DBFHEADER ) )
{
pHeader.bHasTags = 1;
hb_fsSeek( pAreaCdx->hDataFile, 0, FS_SET );
hb_fsWrite( pAreaCdx->hDataFile, ( BYTE * ) &pHeader, sizeof( DBFHEADER ) );
}
}