mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -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;
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue