summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/stc/cdeq.h2
-rw-r--r--include/stc/cvec.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h
index 1d75408c..128b85ee 100644
--- a/include/stc/cdeq.h
+++ b/include/stc/cdeq.h
@@ -125,7 +125,7 @@ _cx_memb(_insert_n)(_cx_self* self, const size_t idx, const _cx_value arr[], con
}
STC_INLINE _cx_iter
_cx_memb(_insert_at)(_cx_self* self, _cx_iter it, i_key value) {
- return _cx_memb(_insert_range)(self, it.ref, &value, &value + 1);
+ return _cx_memb(_insert_range)(self, (it.ref ? it.ref : it.end), &value, &value + 1);
}
STC_INLINE _cx_iter
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index 170bf741..92065619 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -169,7 +169,7 @@ _cx_memb(_insert_n)(_cx_self* self, const size_t idx, const _cx_value arr[], con
}
STC_INLINE _cx_iter
_cx_memb(_insert_at)(_cx_self* self, _cx_iter it, i_key value) {
- return _cx_memb(_insert_range)(self, it.ref, &value, &value + 1);
+ return _cx_memb(_insert_range)(self, (it.ref ? it.ref : it.end), &value, &value + 1);
}
STC_INLINE _cx_iter