aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1997-10-18 21:22:25 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1997-10-18 21:22:25 +0000
commit60ae49aa2a9e694755f5405bf34a6b9a382c4e17 (patch)
treee5f0797a21eb52e462dd020b12b15a3f3b8b18ff /usr.sbin/sade
parentaa916cfa2cdddd9e4ca00708ad7d8118a9cbd946 (diff)
downloadsrc-60ae49aa2a9e694755f5405bf34a6b9a382c4e17.tar.gz
src-60ae49aa2a9e694755f5405bf34a6b9a382c4e17.zip
Fix disk counting bug.
Submitted by: Arjan de Vet <Arjan.deVet@adv.IAEhv.nl>
Notes
Notes: svn path=/head/; revision=30561
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/disks.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index e05a78f8b7a4..9c8647f578b5 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: disks.c,v 1.91 1997/09/11 17:12:08 jkh Exp $
+ * $Id: disks.c,v 1.92 1997/10/12 16:21:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -538,9 +538,10 @@ diskPartitionEditor(dialogMenuItem *self)
{
DMenu *menu;
Device **devs;
- int i, cnt;
+ int i, cnt, devcnt;
cnt = diskGetSelectCount(&devs);
+ devcnt = deviceCount(devs);
if (cnt == -1) {
msgConfirm("No disks found! Please verify that your disk controller is being\n"
"properly probed at boot time. See the Hardware Guide on the\n"
@@ -549,7 +550,7 @@ diskPartitionEditor(dialogMenuItem *self)
}
else if (cnt) {
/* Some are already selected */
- for (i = 0; i < cnt; i++) {
+ for (i = 0; i < devcnt; i++) {
if (devs[i]->enabled) {
if (variable_get(VAR_NONINTERACTIVE))
diskPartitionNonInteractive(devs[i]);
@@ -560,8 +561,7 @@ diskPartitionEditor(dialogMenuItem *self)
}
else {
/* No disks are selected, fall-back case now */
- cnt = deviceCount(devs);
- if (cnt == 1) {
+ if (devcnt == 1) {
devs[0]->enabled = TRUE;
if (variable_get(VAR_NONINTERACTIVE))
diskPartitionNonInteractive(devs[0]);