aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-22 09:12:56 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-22 09:14:58 +0100
commitc240368d5da8208c15e0263034384414d938afb3 (patch)
tree409ff08a60386ce3411ce631b238212b95295121 /text.c
parent811fadc9f7aca0287af3755bacfe77da363a15b2 (diff)
downloadvis-c240368d5da8208c15e0263034384414d938afb3.tar.gz
vis-c240368d5da8208c15e0263034384414d938afb3.tar.xz
text: avoid undefined multiple accesses in expression
Work around for a (bogus?) tis-interpreter warning.
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);
}