From d7c843c23bf73655df201e95fffef36c7e57c298 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 3 Feb 2015 22:32:07 +0100 Subject: Complete cursor-based movement of headers. --- Vector.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Vector.c') diff --git a/Vector.c b/Vector.c index f3212f84..94ad32f6 100644 --- a/Vector.c +++ b/Vector.c @@ -192,6 +192,10 @@ void Vector_insert(Vector* this, int idx, void* data_) { assert(idx <= this->items); assert(Object_isA(data, this->type)); assert(Vector_isConsistent(this)); + + if (idx > this->items) { + idx = this->items; + } Vector_checkArraySize(this); //assert(this->array[this->items] == NULL); -- cgit v1.2.3