aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/writer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/writer.c b/src/writer.c
index 4623c388..f0a9ad16 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -494,13 +494,13 @@ write_text(SerdWriter* const writer,
return st;
}
- if (!size) {
+ if (size > 0U) {
+ i += size - 1U;
+ } else {
// Corrupt input, write replacement character and scan to the next start
st = esink(replacement_char, sizeof(replacement_char), writer);
for (; i < n_bytes && (utf8[i] & 0x80U); ++i) {
}
- } else {
- i += size - 1U;
}
}