summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2014-04-23 11:49:25 +0000
committerotto <otto@openbsd.org>2014-04-23 11:49:25 +0000
commitc810fc4ce2b1a86ccda999bf5fa65f27a4ac5a4c (patch)
tree490865da5ece0660a10e53c1416f91ea713d6af1
parentKill useless assignement, matchlen is initialized two lines below. (diff)
downloadwireguard-openbsd-c810fc4ce2b1a86ccda999bf5fa65f27a4ac5a4c.tar.xz
wireguard-openbsd-c810fc4ce2b1a86ccda999bf5fa65f27a4ac5a4c.zip
don't clear label before readasciilabel(), it will not fill in some
required fields like disk size, causing consistency check failures. with and ok krw@
-rw-r--r--sbin/disklabel/disklabel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 495a36cda7e..a567876d0e8 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -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);