zero ended string added

This commit is contained in:
Antonio Linares
2002-01-31 11:19:42 +00:00
parent 5e244da169
commit 1e933fbb6b

View File

@@ -154,7 +154,7 @@ HB_FUNC( MEMOLINE )
if( ulPos < ulLen || (ulLineNumber == ulLines && ulLineEnd >= ulLineBegin) )
{
ULONG ulSpAdded = 0;
char * pszLine = ( char * ) hb_xgrab( ulLineLength );
char * pszLine = ( char * ) hb_xgrab( ulLineLength + 1 );
memset( pszLine, ' ', ulLineLength );
@@ -171,9 +171,10 @@ HB_FUNC( MEMOLINE )
}
pszLine[ ulLineLength ] = '\0';
hb_retclen_buffer( pszLine, ulLineLength );
}
else
hb_retc( NULL );
}