diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2021-07-26 20:30:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 20:30:10 +0200 |
commit | ec7881bbfd0b41812b39c658cb7c4be7993d113e (patch) | |
tree | 5dda2c4cdd848b191f6d57a5cd875680f4f7ce6d /src/nvim/buffer_updates.c | |
parent | 0e22a40b6d328ac4aa07ed7bc40da200a48ef524 (diff) | |
parent | 3fd4f2f611b60dabdac386f201efe92f52cbf18c (diff) | |
download | rneovim-ec7881bbfd0b41812b39c658cb7c4be7993d113e.tar.gz rneovim-ec7881bbfd0b41812b39c658cb7c4be7993d113e.tar.bz2 rneovim-ec7881bbfd0b41812b39c658cb7c4be7993d113e.zip |
Merge pull request #15180 from gpanders/xcalloc
fix: fix incorrect call sites of xcalloc
Diffstat (limited to 'src/nvim/buffer_updates.c')
-rw-r--r-- | src/nvim/buffer_updates.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index f46cac4637..1d131cc4b1 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -50,7 +50,7 @@ bool buf_updates_register(buf_T *buf, uint64_t channel_id, if (send_buffer) { Array args = ARRAY_DICT_INIT; args.size = 6; - args.items = xcalloc(sizeof(Object), args.size); + args.items = xcalloc(args.size, sizeof(Object)); // the first argument is always the buffer handle args.items[0] = BUFFER_OBJ(buf->handle); @@ -68,7 +68,7 @@ bool buf_updates_register(buf_T *buf, uint64_t channel_id, if (line_count >= 1) { linedata.size = line_count; - linedata.items = xcalloc(sizeof(Object), line_count); + linedata.items = xcalloc(line_count, sizeof(Object)); buf_collect_lines(buf, line_count, 1, true, &linedata, NULL); } @@ -93,7 +93,7 @@ void buf_updates_send_end(buf_T *buf, uint64_t channelid) { Array args = ARRAY_DICT_INIT; args.size = 1; - args.items = xcalloc(sizeof(Object), args.size); + args.items = xcalloc(args.size, sizeof(Object)); args.items[0] = BUFFER_OBJ(buf->handle); rpc_send_event(channelid, "nvim_buf_detach_event", args); } @@ -211,7 +211,7 @@ void buf_updates_send_changes(buf_T *buf, // send through the changes now channel contents now Array args = ARRAY_DICT_INIT; args.size = 6; - args.items = xcalloc(sizeof(Object), args.size); + args.items = xcalloc(args.size, sizeof(Object)); // the first argument is always the buffer handle args.items[0] = BUFFER_OBJ(buf->handle); @@ -230,7 +230,7 @@ void buf_updates_send_changes(buf_T *buf, if (num_added > 0) { STATIC_ASSERT(SIZE_MAX >= MAXLNUM, "size_t smaller than MAXLNUM"); linedata.size = (size_t)num_added; - linedata.items = xcalloc(sizeof(Object), (size_t)num_added); + linedata.items = xcalloc((size_t)num_added, sizeof(Object)); buf_collect_lines(buf, (size_t)num_added, firstline, true, &linedata, NULL); } @@ -394,7 +394,7 @@ void buf_updates_changedtick_single(buf_T *buf, uint64_t channel_id) { Array args = ARRAY_DICT_INIT; args.size = 2; - args.items = xcalloc(sizeof(Object), args.size); + args.items = xcalloc(args.size, sizeof(Object)); // the first argument is always the buffer handle args.items[0] = BUFFER_OBJ(buf->handle); |