Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177587043
D56845.1794803102.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
796 B
Referenced Files
None
Subscribers
None
D56845.1794803102.diff
View Options
diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c
--- a/usr.sbin/mixer/mixer.c
+++ b/usr.sbin/mixer/mixer.c
@@ -70,8 +70,12 @@
optarg += 3;
errno = 0;
dunit = strtol(optarg, NULL, 10);
- if (errno == EINVAL || errno == ERANGE)
- err(1, "strtol(%s)", optarg);
+ if (errno == EINVAL)
+ err(1, "Can not convert '%s' to a number", optarg);
+ if (errno == ERANGE)
+ err(1, "%s", optarg);
+ if (dunit < 0)
+ errx(1, "Unit number must be a positive number");
dflag = 1;
break;
case 'f':
@@ -332,6 +336,8 @@
warn("cannot get default unit");
return (-1);
}
+ if (dunit > mixer_get_nmixers())
+ errx(1, "No such mixer unit: %d", dunit);
if (mixer_set_dunit(m, dunit) < 0) {
warn("cannot set default unit to %d", dunit);
return (-1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 4:25 AM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41759929
Default Alt Text
D56845.1794803102.diff (796 B)
Attached To
Mode
D56845: mixer: Improve error messages
Attached
Detach File
Event Timeline