diff options
author | Dundar Goc <gocdundar@gmail.com> | 2022-04-15 19:49:06 +0200 |
---|---|---|
committer | Dundar Goc <gocdundar@gmail.com> | 2022-04-16 18:09:26 +0200 |
commit | 88270a57358e4009537de9435c19fcb17e66ffdd (patch) | |
tree | 87216094e11d56b9058ac23de43238ff3a469ff6 /src/nvim/ex_eval.c | |
parent | 7a2fcbbbecc96c0179aa9449a1d4e3b5d936a054 (diff) | |
download | rneovim-88270a57358e4009537de9435c19fcb17e66ffdd.tar.gz rneovim-88270a57358e4009537de9435c19fcb17e66ffdd.tar.bz2 rneovim-88270a57358e4009537de9435c19fcb17e66ffdd.zip |
refactor: add function xstrnsave
xstrnsave is a clone of vim_strnsave that uses char* instead of char_u*.
Its purpose short-term is to help reduce the number of casts and for
long-term to replace vim_strnsave as the need to use char_u is
eliminated.
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r-- | src/nvim/ex_eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index f4aaab5c43..a32f7db5f2 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -388,12 +388,12 @@ char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int mesg = ((struct msglist *)value)->throw_msg; if (cmdname != NULL && *cmdname != NUL) { size_t cmdlen = STRLEN(cmdname); - ret = (char *)vim_strnsave((char_u *)"Vim(", 4 + cmdlen + 2 + STRLEN(mesg)); + ret = xstrnsave("Vim(", 4 + cmdlen + 2 + STRLEN(mesg)); STRCPY(&ret[4], cmdname); STRCPY(&ret[4 + cmdlen], "):"); val = ret + 4 + cmdlen + 2; } else { - ret = (char *)vim_strnsave((char_u *)"Vim:", 4 + STRLEN(mesg)); + ret = xstrnsave("Vim:", 4 + STRLEN(mesg)); val = ret + 4; } |