summaryrefslogtreecommitdiffstats
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 e5498eb..0cb69e6 100644
--- a/text.c
+++ b/text.c
@@ -115,7 +115,8 @@ check_utf8_encoding(struct line *line)
&line->data[off + r],
line->len - off - r);
memcpy(&line->data[off], invalid_codepoint_encoding, ELEMSOF(invalid_codepoint_encoding));
- line->len = line->len - r + ELEMSOF(invalid_codepoint_encoding);
+ line->len -= r;
+ line->len += r = ELEMSOF(invalid_codepoint_encoding);
}
}
}