diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-08-08 09:13:14 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-08-08 09:13:25 +0200 |
commit | 872f2d7c59645e5ce0ddfb703a46bed50f16705b (patch) | |
tree | da8664e17a24adb628336b97343fd0a65169c735 | |
parent | f15d887dcdb55a4214bc90308260501adf348e0b (diff) | |
download | xK-872f2d7c59645e5ce0ddfb703a46bed50f16705b.tar.gz xK-872f2d7c59645e5ce0ddfb703a46bed50f16705b.tar.xz xK-872f2d7c59645e5ce0ddfb703a46bed50f16705b.zip |
Fix calloc argument order
-rw-r--r-- | xC.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |