summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-03-02 23:09:28 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-03-02 23:09:28 +0000
commit0b1e72aafd52e0b289d8959f0d461e79eda23b82 (patch)
tree1c670b0a65b0f5e817eb04536121782b09c0a2fb /usr.bin
parent2cc7685dec422d77cb6285a5f9168f2fd6b6d807 (diff)
fix ndev counting loop. report from Stuart Cassoff
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mixerctl/mixerctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mixerctl/mixerctl.c b/usr.bin/mixerctl/mixerctl.c
index db856853beb..d7f339703c7 100644
--- a/usr.bin/mixerctl/mixerctl.c
+++ b/usr.bin/mixerctl/mixerctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mixerctl.c,v 1.15 2004/01/22 17:44:54 vincent Exp $ */
+/* $OpenBSD: mixerctl.c,v 1.16 2004/03/02 23:09:27 tedu Exp $ */
/* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */
/*
@@ -243,7 +243,7 @@ main(int argc, char **argv)
char *sep = "=";
mixer_devinfo_t dinfo;
mixer_ctrl_t val;
- int ndev = 0;
+ int ndev;
if ((file = getenv("MIXERDEVICE")) == 0 || *file == '\0')
file = "/dev/mixer";
@@ -280,8 +280,8 @@ main(int argc, char **argv)
if ((fd = open(file, O_RDONLY)) == -1)
err(1, "%s", file);
- for(;;) {
- dinfo.index = ndev++;
+ for(ndev = 0; ; ndev++) {
+ dinfo.index = ndev;
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &dinfo) < 0)
break;
}