Fix calloc argument order
Alpine 3.20 Success Details

This commit is contained in:
Přemysl Eric Janouch 2024-08-08 09:34:33 +02:00
parent fdf845d0bd
commit 49d7cb12bb
Signed by: p
GPG Key ID: A0420B94F92B9493
2 changed files with 4 additions and 4 deletions

View File

@ -205,8 +205,8 @@ static void
line_editor_start (struct line_editor *self, char prompt) line_editor_start (struct line_editor *self, char prompt)
{ {
self->alloc = 16; self->alloc = 16;
self->line = xcalloc (sizeof *self->line, self->alloc); self->line = xcalloc (self->alloc, sizeof *self->line);
self->w = xcalloc (sizeof *self->w, self->alloc); self->w = xcalloc (self->alloc, sizeof *self->w);
self->len = 0; self->len = 0;
self->point = 0; self->point = 0;
self->prompt = prompt; self->prompt = prompt;

View File

@ -316,7 +316,7 @@ xstrndup (const char *s, size_t n)
#define ARRAY(type, name) type *name; size_t name ## _len, name ## _alloc; #define ARRAY(type, name) type *name; size_t name ## _len, name ## _alloc;
#define ARRAY_INIT_SIZED(a, n) \ #define ARRAY_INIT_SIZED(a, n) \
BLOCK_START \ BLOCK_START \
(a) = xcalloc (sizeof *(a), (a ## _alloc) = (n)); \ (a) = xcalloc ((a ## _alloc) = (n), sizeof *(a)); \
(a ## _len) = 0; \ (a ## _len) = 0; \
BLOCK_END BLOCK_END
#define ARRAY_INIT(a) ARRAY_INIT_SIZED (a, 16) #define ARRAY_INIT(a) ARRAY_INIT_SIZED (a, 16)
@ -398,7 +398,7 @@ strv_make (void)
struct strv self; struct strv self;
self.alloc = 4; self.alloc = 4;
self.len = 0; self.len = 0;
self.vector = xcalloc (sizeof *self.vector, self.alloc); self.vector = xcalloc (self.alloc, sizeof *self.vector);
return self; return self;
} }