mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
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:
parent
fd984e754c
commit
8209a7efe3
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue