瀏覽代碼

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

master
kevin 11 年之前
父節點
當前提交
e5ee3deafd
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. 3
    0
      cmArray.c

+ 3
- 0
cmArray.c 查看文件

@@ -95,6 +95,9 @@ unsigned    cmArrayExpandCount( cmArrayH_t h )
95 95
 
96 96
 unsigned    cmArrayCount(  cmArrayH_t h )
97 97
 {
98
+  if( cmArrayIsValid(h) == false )
99
+    return 0;
100
+
98 101
   cmAr_t* p = _cmArHandleToPtr(h);
99 102
   return p->cur_cnt;
100 103
 }

Loading…
取消
儲存