From 8b4793ecb3281406358f8cbb876718d248356469 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 26 Jul 2004 08:53:31 +0000 Subject: [PATCH] 2004-07-26 10:50 UTC+0100 Viktor Szakats * source/compiler/cmdcheck.c ! Writing out of bound when using -x compiler switch fixed. (Thanks to Chen Kedem) * source/vm/cmdarg.c ! Tabs removed. --- harbour/ChangeLog | 9 +++ harbour/source/compiler/cmdcheck.c | 2 +- harbour/source/vm/cmdarg.c | 90 +++++++++++++++--------------- 3 files changed, 56 insertions(+), 45 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e9563f7d20..c6c0fa5cb7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,15 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-07-26 10:50 UTC+0100 Viktor Szakats + + * source/compiler/cmdcheck.c + ! Writing out of bound when using -x compiler switch fixed. + (Thanks to Chen Kedem) + + * source/vm/cmdarg.c + ! Tabs removed. + 2004-07-26 01:21 UTC+0100 Antonio Linares + source/rtl/scalar.prg * Harbour implementation of Class(y) Class ScalarObject diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index cb33e2d716..977f72971a 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -830,7 +830,7 @@ void hb_compChkEnvironVar( char * szSwitch ) sprintf( szPrefix, "%08lX_", PackDateTime() ); strncpy( hb_comp_szPrefix, szPrefix, 16 ); - hb_comp_szPrefix[ 20 ] = '\0'; + hb_comp_szPrefix[ 16 ] = '\0'; strcat( hb_comp_szPrefix, "_" ); free( szPrefix ); diff --git a/harbour/source/vm/cmdarg.c b/harbour/source/vm/cmdarg.c index 153bcfa5b3..accf923951 100644 --- a/harbour/source/vm/cmdarg.c +++ b/harbour/source/vm/cmdarg.c @@ -316,53 +316,55 @@ ULONG hb_cmdargProcessVM( int *pCancelKey, int *pCancelKeyEx ) if( hb_cmdargCheck( "BUILD" ) ) hb_verBuildInfo(); - - if( (cFlags=hb_cmdargString( "FLAGS" )) != NULL ) - { - int i = 1; - while( cFlags[ i ] ) - { - switch( cFlags[ i++ ] ) - { - case 'c': - /* clear all flags - minimal set of features */ - ulFlags = 0; - break; + + if( (cFlags = hb_cmdargString( "FLAGS" )) != NULL ) + { + int i = 1; + while( cFlags[ i ] ) + { + switch( cFlags[ i++ ] ) + { + case 'c': + /* clear all flags - minimal set of features */ + ulFlags = 0; + break; - case 'h': - /* default Harbour mode */ - ulFlags |= HB_VMFLAG_HARBOUR; - break; + case 'h': + /* default Harbour mode */ + ulFlags |= HB_VMFLAG_HARBOUR; + break; /* - case 'x': - ulFlags |= HB_VMFLAG_XBASE; - break; + case 'x': + ulFlags |= HB_VMFLAG_XBASE; + break; - case 'r': - ulFlags |= HB_VMFLAG_RT_MACRO; - break; + case 'r': + ulFlags |= HB_VMFLAG_RT_MACRO; + break; */ - case 's': - ulFlags |= HB_VMFLAG_ARRSTR; - break; - } - } - hb_xfree( cFlags ); - } + case 's': + ulFlags |= HB_VMFLAG_ARRSTR; + break; + } + } + hb_xfree( cFlags ); + } - if( (cFlags=hb_cmdargString( "CANCEL" )) != NULL ) - { - int iVal = atoi( cFlags ); - if( iVal ) - *pCancelKey = iVal; - hb_xfree( cFlags ); - } - if( (cFlags=hb_cmdargString( "CANCELEX" )) != NULL ) - { - int iVal = atoi( cFlags ); - if( iVal ) - *pCancelKeyEx = iVal; - hb_xfree( cFlags ); - } - return ulFlags; + if( (cFlags=hb_cmdargString( "CANCEL" )) != NULL ) + { + int iVal = atoi( cFlags ); + if( iVal ) + *pCancelKey = iVal; + hb_xfree( cFlags ); + } + + if( (cFlags=hb_cmdargString( "CANCELEX" )) != NULL ) + { + int iVal = atoi( cFlags ); + if( iVal ) + *pCancelKeyEx = iVal; + hb_xfree( cFlags ); + } + + return ulFlags; }