fix(api): handle NUL in nvim_err_write() and nvim_out_write()

(cherry picked from commit 49254ddebe)
This commit is contained in:
zeertzjq
2023-09-25 10:34:45 +08:00
committed by github-actions[bot]
parent c21ca9b87a
commit 00c3ffdb4b
2 changed files with 44 additions and 8 deletions

View File

@@ -1692,6 +1692,8 @@ static void write_msg(String message, bool to_err, bool writeln)
msg_didout = true; \
kv_drop(line_buf, kv_size(line_buf)); \
kv_resize(line_buf, LINE_BUFFER_MIN_SIZE); \
} else if (c == NUL) { \
kv_push(line_buf, NL); \
} else { \
kv_push(line_buf, c); \
}