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.
This commit is contained in:
Dundar Goc
2022-04-15 19:49:06 +02:00
parent 7a2fcbbbec
commit 88270a5735
4 changed files with 13 additions and 6 deletions

View File

@@ -433,7 +433,7 @@ static int cs_add_common(char *arg1, char *arg2, char *flags)
if (fname == NULL) {
goto add_err;
}
fname = (char *)vim_strnsave((char_u *)fname, len);
fname = xstrnsave(fname, len);
xfree(fbuf);
FileInfo file_info;
bool file_info_ok = os_fileinfo(fname, &file_info);