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
Branches
Tags
No related merge requests found
...@@ -152,9 +152,9 @@ int calc_item(struct dir *par, char *name) { ...@@ -152,9 +152,9 @@ int calc_item(struct dir *par, char *name) {
linksl *= 2; linksl *= 2;
if(!linksl) { if(!linksl) {
linksl = 64; linksl = 64;
links = malloc(linksl); links = malloc(linksl*sizeof(struct link_inode));
} else } else
links = realloc(links, linksl); links = realloc(links, linksl*sizeof(struct link_inode));
} }
links[i].dev = fs.st_dev; links[i].dev = fs.st_dev;
links[i].ino = fs.st_ino; 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