From bbac1686f604845a98f087b8b72945a0aa3d36bd Mon Sep 17 00:00:00 2001 From: jvech Date: Tue, 25 Jan 2022 11:20:17 -0500 Subject: Unknown malloc error saw, I'm not pretty sure how to solve it malloc(): corrupted top size Aborted (core dumped) the malloc in list_create function has a cast to list * --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index cf811d8..e3ba8ea 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ void error(char *c) list *list_create(char title[], char id[]) { - list *x = malloc(sizeof(list)); + list *x = (list *)malloc(sizeof(list)); sscanf(title, "%199[^\n]", x->name); sscanf(id, "%11s", x->id); x->next = NULL; -- cgit v1.2.3-70-g09d2