From 86a4b2e48f4fe0de3a738dbd739d10c3a1256ef9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 17 Mar 2011 08:24:21 +0000 Subject: [PATCH] 2011-03-17 09:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbct/disk.c ! Fixed regression in prev patch. [via Andi] --- harbour/ChangeLog | 4 ++++ harbour/contrib/hbct/disk.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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 );