diff options
author | jvech <jmvalenciae@unal.edu.co> | 2022-01-25 11:20:17 -0500 |
---|---|---|
committer | jvech <jmvalenciae@unal.edu.co> | 2022-01-25 11:20:17 -0500 |
commit | bbac1686f604845a98f087b8b72945a0aa3d36bd (patch) | |
tree | 7c8861abd1794d59b0f0b52ad7ec51cbc9deb3a0 | |
parent | c3ebe7fe98668098f610b2e38461496f8987aca9 (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 *
-rw-r--r-- | main.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |