Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/usr.bin/audiocfg Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/9e04a8d59021
branches:  netbsd-9
changeset: 454798:9e04a8d59021
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Sep 28 07:25:53 2019 +0000

description:
Pull up following revision(s) (requested by isaki in ticket #258):

        usr.bin/audiocfg/main.c: revision 1.9

Fix assertion of "audiocfg list <n>" when n is an illegal index.

diffstat:

 usr.bin/audiocfg/main.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r be0cd496bb35 -r 9e04a8d59021 usr.bin/audiocfg/main.c
--- a/usr.bin/audiocfg/main.c   Sat Sep 28 07:24:29 2019 +0000
+++ b/usr.bin/audiocfg/main.c   Sat Sep 28 07:25:53 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.8 2019/05/08 14:36:12 isaki Exp $ */
+/* $NetBSD: main.c,v 1.8.2.1 2019/09/28 07:25:53 martin Exp $ */
 
 /*
  * Copyright (c) 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -164,7 +164,12 @@
                if (errno)
                        usage(argv[0]);
                        /* NOTREACHED */
-               print_audiodev(audiodev_get(i), i);
+               adev = audiodev_get(i);
+               if (adev == NULL) {
+                       fprintf(stderr, "no such device\n");
+                       return EXIT_FAILURE;
+               }
+               print_audiodev(adev, i);
        } else if (strcmp(argv[1], "default") == 0 && argc == 3) {
                if (*argv[2] < '0' || *argv[2] > '9')
                        usage(argv[0]);



Home | Main Index | Thread Index | Old Index