summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-08-08 09:13:14 +0200
committerPřemysl Eric Janouch <p@janouch.name>2024-08-08 09:13:25 +0200
commit872f2d7c59645e5ce0ddfb703a46bed50f16705b (patch)
treeda8664e17a24adb628336b97343fd0a65169c735
parentf15d887dcdb55a4214bc90308260501adf348e0b (diff)
downloadxK-872f2d7c59645e5ce0ddfb703a46bed50f16705b.tar.gz
xK-872f2d7c59645e5ce0ddfb703a46bed50f16705b.tar.xz
xK-872f2d7c59645e5ce0ddfb703a46bed50f16705b.zip
Fix calloc argument order
-rw-r--r--xC.c6
1 files 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)