Fix issue in IT_INSERT (Wrong behavior if IT==END)
This commit is contained in:
1 parent
274afc9978
commit
c2e19fed01
1 file changed
+3
-2
@@ -769,8 +769,9 @@
|
|||||||
M_C(name, _insert)(array_t a, it_t it, type const x) \
|
M_C(name, _insert)(array_t a, it_t it, type const x) \
|
||||||
{ \
|
{ \
|
||||||
M_ASSERT (it != NULL && a == it->array); \
|
M_ASSERT (it != NULL && a == it->array); \
|
||||||
M_C(name, _push_at)(a, it->index + 1, x); \
|
size_t index = M_C(name, _end_p)(it) ? 0 : it->index+1; \
|
||||||
it->index ++; \
|
M_C(name, _push_at)(a, index, x); \
|
||||||
|
it->index = index; \
|
||||||
} \
|
} \
|
||||||
, /* End of INIT_SET */ ) \
|
, /* End of INIT_SET */ ) \
|
||||||
\
|
\
|
||||||
|
|||||||
Reference in new issue
Block a user