If numdirs is zero, print a helpful message instead of divding by zero later.
This commit is contained in:
parent
1b0783ba37
commit
c5d3d7fd74
@ -295,6 +295,10 @@ setup(dev)
|
|||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
numdirs = sblock.fs_cstotal.cs_ndir;
|
numdirs = sblock.fs_cstotal.cs_ndir;
|
||||||
|
if (numdirs == 0) {
|
||||||
|
printf("numdirs is zero, try using an alternate superblock\n");
|
||||||
|
goto badsb;
|
||||||
|
}
|
||||||
inplast = 0;
|
inplast = 0;
|
||||||
listmax = numdirs + 10;
|
listmax = numdirs + 10;
|
||||||
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
|
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
|
||||||
|
@ -295,6 +295,10 @@ setup(dev)
|
|||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
numdirs = sblock.fs_cstotal.cs_ndir;
|
numdirs = sblock.fs_cstotal.cs_ndir;
|
||||||
|
if (numdirs == 0) {
|
||||||
|
printf("numdirs is zero, try using an alternate superblock\n");
|
||||||
|
goto badsb;
|
||||||
|
}
|
||||||
inplast = 0;
|
inplast = 0;
|
||||||
listmax = numdirs + 10;
|
listmax = numdirs + 10;
|
||||||
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
|
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
|
||||||
|
@ -295,6 +295,10 @@ setup(dev)
|
|||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
numdirs = sblock.fs_cstotal.cs_ndir;
|
numdirs = sblock.fs_cstotal.cs_ndir;
|
||||||
|
if (numdirs == 0) {
|
||||||
|
printf("numdirs is zero, try using an alternate superblock\n");
|
||||||
|
goto badsb;
|
||||||
|
}
|
||||||
inplast = 0;
|
inplast = 0;
|
||||||
listmax = numdirs + 10;
|
listmax = numdirs + 10;
|
||||||
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
|
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user