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...
This commit is contained in:
Yorhel 2009-05-05 19:33:30 +02:00
parent fd984e754c
commit 8209a7efe3

View file

@ -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;