dd->dd_no_mbr has to always be initialized. It doesn't default to 0 since

it is allocated on the stack.  Thus, allow editing the MBR partition table
on disks that actually have a MBR.
This commit is contained in:
cube 2004-05-18 14:07:06 +00:00
parent 91a01d5aed
commit 0d27523fe4

View File

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.85 2004/05/15 21:53:29 dsl Exp $ */
/* $NetBSD: disks.c,v 1.86 2004/05/18 14:07:06 cube Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -104,8 +104,10 @@ get_disks(struct disk_desc *dd)
cp = strchr(dd->dd_name, ':');
if (cp != NULL)
dd->dd_no_mbr = ~strcmp(cp, ":no_mbr");
else
else {
dd->dd_no_mbr = 0;
cp = strchr(dd->dd_name, 0);
}
snprintf(cp, 2 + 1, "%d", i);
if (!get_geom(dd->dd_name, &l)) {