From: Mark Sibly Date: Thu, 9 Mar 2017 01:16:49 +0000 (+1300) Subject: Added size!=0 checks for memset, memcpy and memmove X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=a0641f87078095a18759ad90285ab61608cbcde0;p=blitzmax.git Added size!=0 checks for memset, memcpy and memmove --- diff --git a/mod/brl.mod/blitz.mod/blitz_memory.c b/mod/brl.mod/blitz.mod/blitz_memory.c index 83e8f80..f432ab1 100644 --- a/mod/brl.mod/blitz.mod/blitz_memory.c +++ b/mod/brl.mod/blitz.mod/blitz_memory.c @@ -41,13 +41,13 @@ void *bbMemExtend( void *mem,int size,int new_size ){ } void bbMemClear( void *dst,int size ){ - memset( dst,0,size ); + if( size ) memset( dst,0,size ); } void bbMemCopy( void *dst,const void *src,int size ){ - memcpy( dst,src,size ); + if( size ) memcpy( dst,src,size ); } void bbMemMove( void *dst,const void *src,int size ){ - memmove( dst,src,size ); + if( size ) memmove( dst,src,size ); }