Module Name:    src
Committed By:   isaki
Date:           Sun Oct 28 01:51:20 UTC 2012

Modified Files:
        src/usr.bin/mixerctl: mixerctl.c

Log Message:
Avoid SEGV even if audio device has no mixer features.
Fix PR/47003


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/mixerctl/mixerctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/mixerctl/mixerctl.c
diff -u src/usr.bin/mixerctl/mixerctl.c:1.24 src/usr.bin/mixerctl/mixerctl.c:1.25
--- src/usr.bin/mixerctl/mixerctl.c:1.24	Tue Jul 14 21:02:24 2009
+++ src/usr.bin/mixerctl/mixerctl.c	Sun Oct 28 01:51:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mixerctl.c,v 1.24 2009/07/14 21:02:24 apb Exp $	*/
+/*	$NetBSD: mixerctl.c,v 1.25 2012/10/28 01:51:20 isaki Exp $	*/
 
 /*
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: mixerctl.c,v 1.24 2009/07/14 21:02:24 apb Exp $");
+__RCSID("$NetBSD: mixerctl.c,v 1.25 2012/10/28 01:51:20 isaki Exp $");
 #endif
 
 #include <stdio.h>
@@ -429,7 +429,7 @@ main(int argc, char **argv)
 	}
 
 	if (argc == 0 && aflag && !wflag) {
-		for(i = 0; fields[i].name; i++) {
+		for(i = 0; i < j; i++) {
 			prfield(&fields[i], sep, vflag);
 			fprintf(out, "\n");
 		}

Reply via email to