Fix calloc argument order
Alpine 3.20 Success Details
Arch Linux AUR Success Details
OpenBSD 7.5 Success Details

This commit is contained in:
Přemysl Eric Janouch 2024-08-08 09:13:14 +02:00
parent f15d887dcd
commit 872f2d7c59
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 3 deletions

6
xC.c
View File

@ -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)