From a0641f87078095a18759ad90285ab61608cbcde0 Mon Sep 17 00:00:00 2001 From: Mark Sibly Date: Thu, 9 Mar 2017 14:16:49 +1300 Subject: [PATCH] Added size!=0 checks for memset, memcpy and memmove --- mod/brl.mod/blitz.mod/blitz_memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ); } -- 2.30.2