diff options
-rw-r--r-- | pjlib/include/pj/array.h | 2 | ||||
-rw-r--r-- | pjlib/src/pj/array.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pjlib/include/pj/array.h b/pjlib/include/pj/array.h index ed234f96..f37fa75b 100644 --- a/pjlib/include/pj/array.h +++ b/pjlib/include/pj/array.h @@ -42,7 +42,7 @@ PJ_BEGIN_DECL * * @param array the array. * @param elem_size the size of the individual element. - * @param count the current number of elements in the array. + * @param count the CURRENT number of elements in the array. * @param pos the position where the new element is put. * @param value the value to copy to the new element. */ diff --git a/pjlib/src/pj/array.c b/pjlib/src/pj/array.c index 0075214e..8d63868f 100644 --- a/pjlib/src/pj/array.c +++ b/pjlib/src/pj/array.c @@ -27,7 +27,7 @@ PJ_DEF(void) pj_array_insert( void *array, unsigned pos, const void *value) { - if (count && pos < count-1) { + if (count && pos < count) { pj_memmove( (char*)array + (pos+1)*elem_size, (char*)array + pos*elem_size, (count-pos)*elem_size); |