Clear part_set, part_size_type and part_offset_type before parsing the

ascii label; otherwise checklabel() might report spurious errors because
of leftovers from a previous pass.

Reviewed by:	bde
MFC after:	1 week
This commit is contained in:
des 2003-01-16 12:57:53 +00:00
parent 6ceb6e6fac
commit eac0b70cbc
2 changed files with 6 additions and 0 deletions

View File

@ -957,6 +957,9 @@ getasciilabel(FILE *f, struct disklabel *lp)
int lineno = 0, errors = 0;
int i;
bzero(&part_set, sizeof(part_set));
bzero(&part_size_type, sizeof(part_size_type));
bzero(&part_offset_type, sizeof(part_offset_type));
lp->d_bbsize = BBSIZE; /* XXX */
lp->d_sbsize = 0; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {

View File

@ -957,6 +957,9 @@ getasciilabel(FILE *f, struct disklabel *lp)
int lineno = 0, errors = 0;
int i;
bzero(&part_set, sizeof(part_set));
bzero(&part_size_type, sizeof(part_size_type));
bzero(&part_offset_type, sizeof(part_offset_type));
lp->d_bbsize = BBSIZE; /* XXX */
lp->d_sbsize = 0; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {