Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Feb 2012 15:42:07 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r230982 - stable/9/usr.sbin/mixer
Message-ID:  <201202041542.q14Fg7gh041373@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Feb  4 15:42:07 2012
New Revision: 230982
URL: http://svn.freebsd.org/changeset/base/230982

Log:
  MFC r230611:
  Return proper error message if recording device is not specified.

Modified:
  stable/9/usr.sbin/mixer/mixer.c
Directory Properties:
  stable/9/usr.sbin/mixer/   (props changed)

Modified: stable/9/usr.sbin/mixer/mixer.c
==============================================================================
--- stable/9/usr.sbin/mixer/mixer.c	Sat Feb  4 15:00:26 2012	(r230981)
+++ stable/9/usr.sbin/mixer/mixer.c	Sat Feb  4 15:42:07 2012	(r230982)
@@ -193,13 +193,18 @@ main(int argc, char *argv[])
 			argc--;
 			argv++;
 			continue;
-		} else if (argc > 1 && strcmp("rec", *argv + 1) == 0) {
+		} else if (strcmp("rec", *argv + 1) == 0) {
 			if (**argv != '+' && **argv != '-' &&
 			    **argv != '=' && **argv != '^') {
 				warnx("unknown modifier: %c", **argv);
 				dusage = 1;
 				break;
 			}
+			if (argc <= 1) {
+				warnx("no recording device specified");
+				dusage = 1;
+				break;
+			}
 			if ((dev = res_name(argv[1], recmask)) == -1) {
 				warnx("unknown recording device: %s", argv[1]);
 				dusage = 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202041542.q14Fg7gh041373>