don't clear label before readasciilabel(), it will not fill in some
authorotto <otto@openbsd.org>
Wed, 23 Apr 2014 11:49:25 +0000 (11:49 +0000)
committerotto <otto@openbsd.org>
Wed, 23 Apr 2014 11:49:25 +0000 (11:49 +0000)
required fields like disk size, causing consistency check failures.
with and ok krw@

sbin/disklabel/disklabel.c

index 495a36c..a567876 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: disklabel.c,v 1.193 2014/03/18 22:36:30 miod Exp $    */
+/*     $OpenBSD: disklabel.c,v 1.194 2014/04/23 11:49:25 otto Exp $    */
 
 /*
  * Copyright (c) 1987, 1993
@@ -838,7 +838,6 @@ edit(struct disklabel *lp, int f)
                ending_sector = DL_GETBEND(&label);
                starting_sector = DL_GETBSTART(&label);
                total_sectors = DL_GETDSIZE(&label);
-               memset(&label, 0, sizeof(label));
                error = getasciilabel(fp, &label);
                DL_SETBEND(&label, ending_sector);
                DL_SETBSTART(&label, starting_sector);