summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2008-01-07 23:10:19 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2008-01-07 23:10:19 +0000
commit2c22c02a444b4c6b73ac30b557ac2687cca2ce93 (patch)
treeb644b56c58a7812ee3c5a2b9327adf12d264d006 /sbin/disklabel
parent1e5aba22f6ace5148b69ebc3340d769ce52d0b96 (diff)
Oops. Need to ensure we zero selected partition too.
Diffstat (limited to 'sbin/disklabel')
-rw-r--r--sbin/disklabel/editor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 7488289594f..320e9e34ba0 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.145 2008/01/07 19:24:33 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.146 2008/01/07 23:10:18 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.145 2008/01/07 19:24:33 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.146 2008/01/07 23:10:18 krw Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -496,6 +496,8 @@ editor_add(struct disklabel *lp, char **mp, u_int64_t *freep, char *p)
for(; lp->d_npartitions <= partno; lp->d_npartitions++)
memset(&lp->d_partitions[lp->d_npartitions], 0, sizeof(*pp));
+ /* Make sure selected partition is zero'd too. */
+ memset(pp, 0, sizeof(*pp));
chunks = free_chunks(lp);
/*