diff options
author | Yorhel <git@yorhel.nl> | 2009-05-05 19:33:30 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-05-05 19:33:30 +0200 |
commit | 8209a7efe3908f6935c5cd78f2099bdeb802e784 (patch) | |
tree | a6a5fd67d6b236355c46e5926a065813bf5e57f2 | |
parent | fd984e754c4afb18447afa313aaa3c5699471f30 (diff) |
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...
-rw-r--r-- | src/calc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |