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