From 872f2d7c59645e5ce0ddfb703a46bed50f16705b Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 8 Aug 2024 09:13:14 +0200 Subject: Fix calloc argument order --- xC.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xC.c b/xC.c index 85d2e74..df73492 100644 --- a/xC.c +++ b/xC.c @@ -1030,7 +1030,7 @@ input_el__save_buffer (struct input_el *self, struct input_el_buffer *buffer) int len = info->lastchar - info->buffer; int point = info->cursor - info->buffer; - wchar_t *line = calloc (sizeof *info->buffer, len + 1); + wchar_t *line = xcalloc (len + 1, sizeof *info->buffer); memcpy (line, info->buffer, sizeof *info->buffer * len); el_cursor (self->editline, len - point); el_wdeletestr (self->editline, len); @@ -1635,7 +1635,7 @@ static struct formatter formatter_make (struct app_context *ctx, struct server *s) { struct formatter self = { .ctx = ctx, .s = s, .clean = true }; - self.items = xcalloc (sizeof *self.items, (self.items_alloc = 16)); + self.items = xcalloc ((self.items_alloc = 16), sizeof *self.items); return self; } @@ -14757,7 +14757,7 @@ on_editline_return (EditLine *editline, int key) const LineInfoW *info = el_wline (editline); int len = info->lastchar - info->buffer; - wchar_t *line = calloc (sizeof *info->buffer, len + 1); + wchar_t *line = xcalloc (len + 1, sizeof *info->buffer); memcpy (line, info->buffer, sizeof *info->buffer * len); if (*line) -- cgit v1.2.3-70-g09d2