aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorjvech <jmvalenciae@unal.edu.co>2022-01-25 11:20:17 -0500
committerjvech <jmvalenciae@unal.edu.co>2022-01-25 11:20:17 -0500
commitbbac1686f604845a98f087b8b72945a0aa3d36bd (patch)
tree7c8861abd1794d59b0f0b52ad7ec51cbc9deb3a0 /main.c
parentc3ebe7fe98668098f610b2e38461496f8987aca9 (diff)
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 *
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
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;
Feel free to download, copy and edit any repo