mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-16 06:52:27 +00:00
Remove unneeded checks.
MFC after: 1 week
This commit is contained in:
parent
3a01367a9b
commit
b11075cdeb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227262
|
@ -831,7 +831,7 @@ getasciilabel(FILE *f, struct disklabel *lp)
|
|||
continue;
|
||||
}
|
||||
if (sscanf(cp, "%lu partitions", &v) == 1) {
|
||||
if (v == 0 || v > MAXPARTITIONS) {
|
||||
if (v > MAXPARTITIONS) {
|
||||
fprintf(stderr,
|
||||
"line %d: bad # of partitions\n", lineno);
|
||||
lp->d_npartitions = MAXPARTITIONS;
|
||||
|
@ -1186,8 +1186,7 @@ checklabel(struct disklabel *lp)
|
|||
lp->d_secperunit = vl->d_secperunit;
|
||||
if (lp->d_bbsize == 0)
|
||||
lp->d_bbsize = vl->d_bbsize;
|
||||
if (lp->d_npartitions == 0 ||
|
||||
lp->d_npartitions < DEFPARTITIONS ||
|
||||
if (lp->d_npartitions < DEFPARTITIONS ||
|
||||
lp->d_npartitions > MAXPARTITIONS)
|
||||
lp->d_npartitions = vl->d_npartitions;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue