From 1050cd8fb20a0f73045fa2fd563e5d38bae4c28c Mon Sep 17 00:00:00 2001 From: April White Date: Thu, 18 Jun 2009 14:43:17 +0000 Subject: [PATCH] 2009-06-18 16:14 UTC+0600 April White (april@users.sourceforge.net) * source/rtl/mlcfunc.c * detect if parameter is a string vs array * allocate memory for the array before resetting the counter --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/mlcfunc.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index efcf0306d9..ae1fa43ef1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-18 16:14 UTC+0600 April White (april@users.sourceforge.net) + * source/rtl/mlcfunc.c + * detect if parameter is a string vs array + * allocate memory for the array before resetting the counter + 2009-06-18 14:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbct/Makefile - contrib/hbct/dattime4.c diff --git a/harbour/source/rtl/mlcfunc.c b/harbour/source/rtl/mlcfunc.c index 18da265a95..b5d03ab743 100644 --- a/harbour/source/rtl/mlcfunc.c +++ b/harbour/source/rtl/mlcfunc.c @@ -166,9 +166,9 @@ static PHB_EOL_INFO hb_mlGetEOLs( int iParam, int * piEOLs ) char * szEOL; ULONG ulLen, ul; - szEOL = hb_parc( iParam ); - if( szEOL ) + if( HB_ISCHAR( iParam ) ) { + szEOL = hb_parc( iParam ); ulLen = hb_parclen( iParam ); if( ulLen ) { @@ -189,8 +189,8 @@ static PHB_EOL_INFO hb_mlGetEOLs( int iParam, int * piEOLs ) } if( iEOLs ) { - iEOLs = 0; pEOLs = ( PHB_EOL_INFO ) hb_xgrab( sizeof( HB_EOL_INFO ) * iEOLs ); + iEOLs = 0; for( ul = 1; ul <= ulSize; ++ul ) { ulLen = hb_arrayGetCLen( pArray, ul );