diff --git a/ChangeLog.txt b/ChangeLog.txt index 746c9b7562..ab03f097e3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,18 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2015-06-02 13:31 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbtip/client.prg + * eliminated hb_UserName() from initial random seed + + * contrib/hbwin/win_prn2.c + ! fixed memory leak and potentially wrong handle usage + fix borrowed from Viktor's branch: + 2015-06-02 12:39-57 UTC+0200 Viktor Szakats + + * src/rdd/dbf1.c + * variable localization + 2015-05-27 13:56 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/Makefile * src/rtl/net.c diff --git a/contrib/hbtip/client.prg b/contrib/hbtip/client.prg index c08ed3349f..c10835a629 100644 --- a/contrib/hbtip/client.prg +++ b/contrib/hbtip/client.prg @@ -231,7 +231,7 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS TIPClient hb_inetInit() IF ::lHasSSL SSL_init() - RAND_seed( hb_randStr( 20 ) + hb_UserName() + hb_TToS( hb_DateTime() ) + NetName() ) + RAND_seed( hb_randStr( 20 ) + hb_TToS( hb_DateTime() ) + NetName() ) ENDIF ::bInitSocks := .T. ENDIF diff --git a/contrib/hbwin/win_prn2.c b/contrib/hbwin/win_prn2.c index 82e88a6c7d..f207d94354 100644 --- a/contrib/hbwin/win_prn2.c +++ b/contrib/hbwin/win_prn2.c @@ -127,12 +127,11 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName ) if( hb_iswin2k() ) /* Windows 2000 or later */ { typedef BOOL( WINAPI * DEFPRINTER ) ( LPTSTR, LPDWORD ); - DEFPRINTER fnGetDefaultPrinter; HMODULE hWinSpool = hbwapi_LoadLibrarySystem( TEXT( "winspool.drv" ) ); if( hWinSpool ) { - fnGetDefaultPrinter = ( DEFPRINTER ) HB_WINAPI_GETPROCADDRESST( hWinSpool, + DEFPRINTER fnGetDefaultPrinter = ( DEFPRINTER ) HB_WINAPI_GETPROCADDRESST( hWinSpool, "GetDefaultPrinter" ); if( fnGetDefaultPrinter ) @@ -300,7 +299,7 @@ HB_FUNC( WIN_PRINTERSTATUS ) } } - CloseHandle( hPrinter ); + ClosePrinter( hPrinter ); } hb_strfree( hPrinterName ); @@ -606,8 +605,8 @@ HB_FUNC( WIN_PRINTERLIST ) hb_arrayAddForward( pPrinterArray, pTempItem ); } + ClosePrinter( hPrinter ); } - CloseHandle( hPrinter ); } } } diff --git a/src/rdd/dbf1.c b/src/rdd/dbf1.c index 489e2944e9..229509c9b8 100644 --- a/src/rdd/dbf1.c +++ b/src/rdd/dbf1.c @@ -2126,14 +2126,12 @@ static HB_ERRCODE hb_dbfGetRec( DBFAREAP pArea, HB_BYTE ** pBuffer ) static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pItem ) { LPFIELD pField; - PHB_ITEM pError; HB_BOOL fError; char * pszVal; HB_SIZE nLen; HB_MAXINT lVal; double dVal; HB_BOOL fDbl; - int iLen; HB_TRACE( HB_TR_DEBUG, ( "hb_dbfGetValue(%p, %hu, %p)", pArea, uiIndex, pItem ) ); @@ -2241,6 +2239,8 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI case HB_FT_ROWVER: if( pField->uiDec ) { + int iLen; + switch( pField->uiLen ) { case 1: @@ -2375,7 +2375,7 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, HB_USHORT uiIndex, PHB_ITEM pI /* Any error? */ if( fError ) { - pError = hb_errNew(); + PHB_ITEM pError = hb_errNew(); hb_errPutGenCode( pError, EG_DATATYPE ); hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_DATATYPE ) ); hb_errPutOperation( pError, hb_dynsymName( ( PHB_DYNS ) pField->sym ) );