Skip to content
Snippets Groups Projects
Commit 8209a7ef authored by Yorhel's avatar Yorhel
Browse files

Allocate correct amount of memory for the links list

I happen to make these kinds of mistakes a lot, for some strange
reason. Maybe I should just get more sleep...
parent fd984e75
No related branches found
No related tags found
No related merge requests found
......@@ -152,9 +152,9 @@ int calc_item(struct dir *par, char *name) {
linksl *= 2;
if(!linksl) {
linksl = 64;
links = malloc(linksl);
links = malloc(linksl*sizeof(struct link_inode));
} else
links = realloc(links, linksl);
links = realloc(links, linksl*sizeof(struct link_inode));
}
links[i].dev = fs.st_dev;
links[i].ino = fs.st_ino;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment