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

This commit is contained in:
zeertzjq
2023-09-25 11:06:15 +08:00
committed by GitHub
parent 9e7c4fe579
commit b3be7b7413
2 changed files with 44 additions and 8 deletions

View File

@@ -1709,6 +1709,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); \
}