summaryrefslogtreecommitdiff
path: root/usr.bin/mixerctl/mixerctl.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-07-19 20:54:22 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-07-19 20:54:22 +0000
commit70776174761b124442593f823366825435da4c87 (patch)
treea2b88d35daa50e85fecceae18778f7dbc54a9592 /usr.bin/mixerctl/mixerctl.c
parent6053cd52d309ea9379ddb9203134cbd09fbad44d (diff)
fix for case no mixer devices are available, got triggered by malloc.conf->J; millert@ ok
Diffstat (limited to 'usr.bin/mixerctl/mixerctl.c')
-rw-r--r--usr.bin/mixerctl/mixerctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/mixerctl/mixerctl.c b/usr.bin/mixerctl/mixerctl.c
index fbbb034211d..f7bc8a3000d 100644
--- a/usr.bin/mixerctl/mixerctl.c
+++ b/usr.bin/mixerctl/mixerctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mixerctl.c,v 1.4 1998/05/02 22:28:07 millert Exp $ */
+/* $OpenBSD: mixerctl.c,v 1.5 1999/07/19 20:54:21 mickey Exp $ */
/* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */
/*
@@ -300,6 +300,10 @@ main(argc, argv)
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &dinfo) < 0)
break;
}
+
+ if (ndev == 0)
+ errx(1, "no mixer devices configured");
+
rfields = calloc(ndev, sizeof *rfields);
fields = calloc(ndev, sizeof *fields);
infos = calloc(ndev, sizeof *infos);