2010-03-12 00:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* src/rtl/filesys.c
    ! Fixed fs_win_get_drive() to return zero (instead of -1) 
      when drive letter wasn't returned by Windows API.
      (it's not clear what is the proper error behavior here)
    ! Fixed fs_win_set_drive() to apply upper limit on input 
      parameter.

  * contrib/rddsql/sddfb/sddfb.c
    * Minor formatting.
This commit is contained in:
Viktor Szakats
2010-03-11 23:40:40 +00:00
parent b4e4cc655b
commit a783c4648f
3 changed files with 18 additions and 4 deletions

View File

@@ -17,6 +17,17 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-03-12 00:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/filesys.c
! Fixed fs_win_get_drive() to return zero (instead of -1)
when drive letter wasn't returned by Windows API.
(it's not clear what is the proper error behavior here)
! Fixed fs_win_set_drive() to apply upper limit on input
parameter.
* contrib/rddsql/sddfb/sddfb.c
* Minor formatting.
2010-03-11 23:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/rddsql/sddfb/sddfb.c
! Few cleanups in the FB RDDSQL interface (macro and type usage).

View File

@@ -229,7 +229,8 @@ static HB_ERRCODE fbOpen( SQLBASEAREAP pArea )
return HB_FAILURE;
}
if ( pSqlda->sqld > pSqlda->sqln ) {
if ( pSqlda->sqld > pSqlda->sqln )
{
uiFields = pSqlda->sqld;
hb_xfree( pSqlda );
pSqlda = ( XSQLDA * ) hb_xgrab( XSQLDA_LENGTH( uiFields ) );

View File

@@ -54,13 +54,15 @@
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999-2001 Viktor Szakats (harbour.01 syenar.hu)
* Copyright 1999-2010 Viktor Szakats (harbour.01 syenar.hu)
* hb_fsSetError()
* hb_fsSetDevMode()
* hb_fsReadLarge()
* hb_fsWriteLarge()
* hb_fsCurDirBuff()
* hb_fsBaseDirBuff()
* fs_win_get_drive()
* fs_win_set_drive()
*
* Copyright 1999 Jose Lalin <dezac@corevia.com>
* hb_fsChDrv()
@@ -334,7 +336,7 @@ static int fs_win_get_drive( void )
if( pFilepath->szDrive )
iDrive = HB_TOUPPER( pFilepath->szDrive[ 0 ] ) - 'A';
else
iDrive = -1;
iDrive = 0;
hb_xfree( pFilepath );
@@ -343,7 +345,7 @@ static int fs_win_get_drive( void )
static void fs_win_set_drive( int iDrive )
{
if( iDrive >= 0 )
if( iDrive >= 0 && iDrive <= 25 )
{
TCHAR szBuffer[ 3 ];