From 13520aae163bfc243fc050cf16b89082c0896eaf Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 3 May 2022 09:29:55 +0800 Subject: fix(coverity): use xstrndup() instead of vim_strsave() (#18363) --- src/nvim/api/vim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/api/vim.c') diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 061653c5af..d9ab097316 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2522,7 +2522,7 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err) // Parse command line exarg_T ea; CmdParseInfo cmdinfo; - char_u *cmdline = vim_strsave((char_u *)str.data); + char_u *cmdline = (char_u *)string_to_cstr(str); if (!parse_cmdline(cmdline, &ea, &cmdinfo)) { api_set_error(err, kErrorTypeException, "Error while parsing command line"); -- cgit