Source-Changes-HG archive

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

[src/trunk]: src/tests/dev/audio don't use variable 'newval' uninitialized wh...



details:   https://anonhg.NetBSD.org/src/rev/8c48db85c6ba
branches:  trunk
changeset: 848901:8c48db85c6ba
user:      tnn <tnn%NetBSD.org@localhost>
date:      Thu Feb 13 18:06:26 2020 +0000

description:
don't use variable 'newval' uninitialized when multiuser mode unchanged

diffstat:

 tests/dev/audio/audiotest.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 17e6a5556953 -r 8c48db85c6ba tests/dev/audio/audiotest.c
--- a/tests/dev/audio/audiotest.c       Thu Feb 13 16:53:32 2020 +0000
+++ b/tests/dev/audio/audiotest.c       Thu Feb 13 18:06:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audiotest.c,v 1.2 2020/02/12 07:02:21 martin Exp $     */
+/*     $NetBSD: audiotest.c,v 1.3 2020/02/13 18:06:26 tnn Exp $        */
 
 /*
  * Copyright (C) 2019 Tetsuya Isaki. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: audiotest.c,v 1.2 2020/02/12 07:02:21 martin Exp $");
+__RCSID("$NetBSD: audiotest.c,v 1.3 2020/02/13 18:06:26 tnn Exp $");
 
 #include <errno.h>
 #include <fcntl.h>
@@ -2331,6 +2331,8 @@
                r = SYSCTLBYNAME(mibname, NULL, NULL, &newval, sizeof(newval));
                REQUIRED_SYS_EQ(0, r);
                DPRINTF("  > new multiuser=%d\n", multiuser);
+       } else {
+               newval = oldval;
        }
 
        /* Do test */
@@ -6109,6 +6111,8 @@
                r = SYSCTLBYNAME(mibname, NULL, NULL, &newval, sizeof(newval));
                REQUIRED_SYS_EQ(0, r);
                DPRINTF("  > new multiuser=%d\n", multiuser);
+       } else {
+               newval = oldval;
        }
 
        /* Do test */



Home | Main Index | Thread Index | Old Index