cmArray.c: When the array handle is invalid cmArrayCount() now returns 0 instead of throwing an error.

This commit is contained in:
kevin 2013-03-31 22:14:26 -07:00
parent 2ccd818b55
commit e5ee3deafd

View File

@ -95,6 +95,9 @@ unsigned cmArrayExpandCount( cmArrayH_t h )
unsigned cmArrayCount( cmArrayH_t h ) unsigned cmArrayCount( cmArrayH_t h )
{ {
if( cmArrayIsValid(h) == false )
return 0;
cmAr_t* p = _cmArHandleToPtr(h); cmAr_t* p = _cmArHandleToPtr(h);
return p->cur_cnt; return p->cur_cnt;
} }