瀏覽代碼

structure/Vector: Check index in _Get against capacity, not count.

Ambroz Bizjak 11 年之前
父節點
當前提交
c8df8836d3
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      structure/Vector_impl.h

+ 1 - 1
structure/Vector_impl.h

@@ -51,7 +51,7 @@ static void Vector_Free (Vector *o)
 
 
 static VectorElem * Vector_Get (Vector *o, size_t index)
 static VectorElem * Vector_Get (Vector *o, size_t index)
 {
 {
-    ASSERT(index < o->count)
+    ASSERT(index < o->capacity)
     
     
     return &o->elems[index];
     return &o->elems[index];
 }
 }