Commit e68c6c62 by Alan Mishchenko

Fix to prevent undefined behavior.

parent d9e68f60
......@@ -127,7 +127,7 @@ static inline Vec_Int_t * Vec_IntStart( int nSize )
Vec_Int_t * p;
p = Vec_IntAlloc( nSize );
p->nSize = nSize;
memset( p->pArray, 0, sizeof(int) * nSize );
if ( p->pArray ) memset( p->pArray, 0, sizeof(int) * nSize );
return p;
}
static inline Vec_Int_t * Vec_IntStartFull( int nSize )
......@@ -135,7 +135,7 @@ static inline Vec_Int_t * Vec_IntStartFull( int nSize )
Vec_Int_t * p;
p = Vec_IntAlloc( nSize );
p->nSize = nSize;
memset( p->pArray, 0xff, sizeof(int) * nSize );
if ( p->pArray ) memset( p->pArray, 0xff, sizeof(int) * nSize );
return p;
}
static inline Vec_Int_t * Vec_IntStartRange( int First, int Range )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment