diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2022-04-24 20:13:23 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-24 20:13:23 -0600 |
commit | cf2d77763f93407db4669b20ef15c708e0e807d7 (patch) | |
tree | df56d70703e47defa2f9b977188faed5360dc06d /src/nvim/strings.c | |
parent | c58219413514caf035ac52eb85b84b1ff31d4722 (diff) | |
parent | 88270a57358e4009537de9435c19fcb17e66ffdd (diff) | |
download | rneovim-cf2d77763f93407db4669b20ef15c708e0e807d7.tar.gz rneovim-cf2d77763f93407db4669b20ef15c708e0e807d7.tar.bz2 rneovim-cf2d77763f93407db4669b20ef15c708e0e807d7.zip |
Merge pull request #18110 from dundargoc/refactor/remove-char_u
refactor: replace char_u variables and functions with char
Diffstat (limited to 'src/nvim/strings.c')
-rw-r--r-- | src/nvim/strings.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 9d4c64e4b1..848044ee7c 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -67,6 +67,13 @@ char_u *vim_strnsave(const char_u *string, size_t len) return (char_u *)strncpy(xmallocz(len), (char *)string, len); } +/// A clone of vim_strnsave() that uses char* instead of char_u* +char *xstrnsave(const char *string, size_t len) + FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ALL +{ + return strncpy(xmallocz(len), string, len); // NOLINT(runtime/printf) +} + /* * Same as vim_strsave(), but any characters found in esc_chars are preceded * by a backslash. |