aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/text.c b/text.c
index b92258f..55edf0e 100644
--- a/text.c
+++ b/text.c
@@ -1341,13 +1341,14 @@ const char *text_newline_char(Text *txt) {
}
static bool text_iterator_init(Iterator *it, size_t pos, Piece *p, size_t off) {
- *it = (Iterator){
+ Iterator iter = (Iterator){
.pos = pos,
.piece = p,
.start = p ? p->data : NULL,
.end = p ? p->data + p->len : NULL,
.text = p ? p->data + off : NULL,
};
+ *it = iter;
return text_iterator_valid(it);
}