diff options
author | des <des@FreeBSD.org> | 2003-01-16 12:57:53 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-01-16 12:57:53 +0000 |
commit | eac0b70cbcd0a15b7393829d3a7cecd161df4b34 (patch) | |
tree | 9230decadae27d6ed4789c2ec9d3215d9cb523c7 /sbin | |
parent | 6ceb6e6fac7e09c747e87eb52fcfbd5858bba3a4 (diff) | |
download | FreeBSD-src-eac0b70cbcd0a15b7393829d3a7cecd161df4b34.zip FreeBSD-src-eac0b70cbcd0a15b7393829d3a7cecd161df4b34.tar.gz |
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
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 3 | ||||
-rw-r--r-- | sbin/disklabel/disklabel.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 786ca62..bbcf0d0 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -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)) { diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 786ca62..bbcf0d0 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -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)) { |