From cd412c2aad12b5fd3a57bd3fb13538eeb377a1ff Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Thu, 21 Aug 2003 09:28:43 +0000 Subject: [PATCH] Fixed GPF on missing dot --- harbour/contrib/samples/environ.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/harbour/contrib/samples/environ.c b/harbour/contrib/samples/environ.c index 11d5aa39d8..35a2443153 100644 --- a/harbour/contrib/samples/environ.c +++ b/harbour/contrib/samples/environ.c @@ -90,7 +90,10 @@ HB_FUNC( FILEEXT ) if( ISCHAR( 1 ) ) { PHB_FNAME pFileName = hb_fsFNameSplit( hb_parc( 1 ) ); - hb_retc( ( pFileName->szExtension ) + 1 ); /* Skip the dot */ + if( pFileName->szExtension != NULL ) + hb_retc( ( pFileName->szExtension ) + 1 ); /* Skip the dot */ + else + hb_retc( "" ); hb_xfree( pFileName ); } else