summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-05-05 19:33:30 +0200
committerYorhel <git@yorhel.nl>2009-05-05 19:33:30 +0200
commit8209a7efe3908f6935c5cd78f2099bdeb802e784 (patch)
treea6a5fd67d6b236355c46e5926a065813bf5e57f2
parentfd984e754c4afb18447afa313aaa3c5699471f30 (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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/calc.c b/src/calc.c
index f9c6064..0c05a05 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -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;