diff options
author | James Tirta Halim <tirtajames45@gmail.com> | 2024-06-03 11:10:30 +0700 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-06-04 09:42:19 +0100 |
commit | 200e7ad1578619e78c664bd0c6be024168433412 (patch) | |
tree | c2387df2811637efb1f743693ed6b8ca172aeb74 /src/nvim/api/buffer.c | |
parent | 4b3845be2e497f96f855782d52dd1d02a4cabb6f (diff) | |
download | rneovim-200e7ad1578619e78c664bd0c6be024168433412.tar.gz rneovim-200e7ad1578619e78c664bd0c6be024168433412.tar.bz2 rneovim-200e7ad1578619e78c664bd0c6be024168433412.zip |
fixup: apply the change on more files
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r-- | src/nvim/api/buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 7e64808709..e078d85f33 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1375,7 +1375,7 @@ static inline void init_line_array(lua_State *lstate, Array *a, size_t size, Are /// @param s String to push /// @param len Size of string /// @param idx 0-based index to place s (only used for Lua) -/// @param replace_nl Replace newlines ('\n') with null ('\0') +/// @param replace_nl Replace newlines ('\n') with null (NUL) static void push_linestr(lua_State *lstate, Array *a, const char *s, size_t len, int idx, bool replace_nl, Arena *arena) { @@ -1384,7 +1384,7 @@ static void push_linestr(lua_State *lstate, Array *a, const char *s, size_t len, if (s && replace_nl && strchr(s, '\n')) { // TODO(bfredl): could manage scratch space in the arena, for the NUL case char *tmp = xmemdupz(s, len); - strchrsub(tmp, '\n', '\0'); + strchrsub(tmp, '\n', NUL); lua_pushlstring(lstate, tmp, len); xfree(tmp); } else { @@ -1397,7 +1397,7 @@ static void push_linestr(lua_State *lstate, Array *a, const char *s, size_t len, str = CBUF_TO_ARENA_STR(arena, s, len); if (replace_nl) { // Vim represents NULs as NLs, but this may confuse clients. - strchrsub(str.data, '\n', '\0'); + strchrsub(str.data, '\n', NUL); } } |