diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 36bae5eefa..e938814cd7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-17 09:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbct/disk.c + ! Fixed regression in prev patch. [via Andi] + 2011-03-17 08:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/common/hbver.c + New Intel compiler version detection. [Tamas Tevesz] diff --git a/harbour/contrib/hbct/disk.c b/harbour/contrib/hbct/disk.c index 80da96c43b..a019c19c98 100644 --- a/harbour/contrib/hbct/disk.c +++ b/harbour/contrib/hbct/disk.c @@ -206,6 +206,8 @@ HB_FUNC( VOLUME ) char * sVolName = NULL; char sRootBuf[ 4 ], sVolNameBuf[ 12 ]; char * pszFree; + LPTSTR lpRoot; + LPTSTR lpVolName; if( hb_parclen( 1 ) > 0 ) { @@ -218,6 +220,7 @@ HB_FUNC( VOLUME ) hb_strncpy( sRootBuf, fname->szPath, sizeof( sRootBuf ) - 1 ); sRoot = sRootBuf; } + if( fname->szName ) { hb_strncpy( sVolNameBuf, fname->szName, sizeof( sVolNameBuf ) - 1 ); @@ -231,12 +234,13 @@ HB_FUNC( VOLUME ) hb_strncpy( sVolNameBuf, sDiskName, sizeof( sVolNameBuf ) - 1 ); sVolName = sVolNameBuf; } + if( pszFree ) hb_xfree( pszFree ); } - LPTSTR lpRoot = sRoot ? HB_TCHAR_CONVTO( sRoot ) : NULL; - LPTSTR lpVolName = sVolName ? HB_TCHAR_CONVTO( sVolName ) : NULL; + lpRoot = sRoot ? HB_TCHAR_CONVTO( sRoot ) : NULL; + lpVolName = sVolName ? HB_TCHAR_CONVTO( sVolName ) : NULL; bReturn = SetVolumeLabel( lpRoot, lpVolName );