diff --git a/src/asm/asmy.y b/src/asm/asmy.y index 29dd9f01..ae927ff3 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -142,8 +142,9 @@ void copyrept( void ) { SLONG level=1, len, instring=0; char *src=pCurrentBuffer->pBuffer; + char *bufferEnd = pCurrentBuffer->pBufferStart + pCurrentBuffer->nBufferSize; - while( *src && level ) + while( src < bufferEnd && level ) { if( instring==0 ) { @@ -217,8 +218,9 @@ void copymacro( void ) { SLONG level=1, len, instring=0; char *src=pCurrentBuffer->pBuffer; + char *bufferEnd = pCurrentBuffer->pBufferStart + pCurrentBuffer->nBufferSize; - while( *src && level ) + while( src < bufferEnd && level ) { if( instring==0 ) {