summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-01-13 21:26:02 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-01-13 21:26:02 +0000
commit35656ce800eccf8bd69ed20788cf1dc4f81b6261 (patch)
tree41287524e7644650a87537d7dcc943e79ef2cac8
parent954c02fff263d15d0a40cec2e8d23a2e2553ef99 (diff)
the mixer_devinfo structure contains next and prev pointers; they are used
to create doubly linked "chains" of mixer devices. Currently mixerctl(1) supposes that the 'next' index is never smaller than the index of the device; so it fails to handle such mixers. The fix, allows 'next' indexes to be smaller than the index of the device. ok jakemsr@
-rw-r--r--usr.bin/mixerctl/mixerctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/mixerctl/mixerctl.c b/usr.bin/mixerctl/mixerctl.c
index a10b8d47e62..8f38555b197 100644
--- a/usr.bin/mixerctl/mixerctl.c
+++ b/usr.bin/mixerctl/mixerctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mixerctl.c,v 1.26 2007/11/26 13:36:34 deraadt Exp $ */
+/* $OpenBSD: mixerctl.c,v 1.27 2008/01/13 21:26:01 ratchov Exp $ */
/* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */
/*
@@ -341,14 +341,13 @@ main(int argc, char **argv)
for (j = i = 0; i < ndev; i++) {
if (infos[i].type != AUDIO_MIXER_CLASS &&
- infos[i].type != -1) {
+ infos[i].prev == AUDIO_MIXER_LAST) {
fields[j++] = rfields[i];
for (pos = infos[i].next; pos != AUDIO_MIXER_LAST;
pos = infos[pos].next) {
fields[j] = rfields[pos];
catstr(rfields[i].name, infos[pos].label.name,
fields[j].name);
- infos[pos].type = -1;
j++;
}
}