From 3fd4f2f611b60dabdac386f201efe92f52cbf18c Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Sat, 24 Jul 2021 15:49:48 -0600 Subject: fix: fix incorrect call sites of xcalloc The number of elements comes first and the size of each element second. --- 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 9b0782f589..bbcfe173c5 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1696,7 +1696,7 @@ void nvim_put(ArrayOf(String) lines, String type, Boolean after, FUNC_API_SINCE(6) FUNC_API_CHECK_TEXTLOCK { - yankreg_T *reg = xcalloc(sizeof(yankreg_T), 1); + yankreg_T *reg = xcalloc(1, sizeof(yankreg_T)); if (!prepare_yankreg_from_object(reg, type, lines.size)) { api_set_error(err, kErrorTypeValidation, "Invalid type: '%s'", type.data); goto cleanup; -- cgit