Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103017520
D45973.id141459.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45973.id141459.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
@@ -426,11 +426,14 @@
m = d->parent_mixer;
cp = mixer_get_ctl(m->dev, C_MUT);
val = p;
- if (strncmp(val, "off", strlen(val)) == 0 || *val == '0')
+ if (strncmp(val, "off", strlen(val)) == 0 ||
+ strncmp(val, "0", strlen(val)) == 0)
opt = MIX_UNMUTE;
- else if (strncmp(val, "on", strlen(val)) == 0 || *val == '1')
+ else if (strncmp(val, "on", strlen(val)) == 0 ||
+ strncmp(val, "1", strlen(val)) == 0)
opt = MIX_MUTE;
- else if (strncmp(val, "toggle", strlen(val)) == 0 || *val == '^')
+ else if (strncmp(val, "toggle", strlen(val)) == 0 ||
+ strncmp(val, "^", strlen(val)) == 0)
opt = MIX_TOGGLEMUTE;
else {
warnx("%s: no such modifier", val);
@@ -459,13 +462,17 @@
m = d->parent_mixer;
cp = mixer_get_ctl(m->dev, C_SRC);
val = p;
- if (strncmp(val, "add", strlen(val)) == 0 || *val == '+')
+ if (strncmp(val, "add", strlen(val)) == 0 ||
+ strncmp(val, "+", strlen(val)) == 0)
opt = MIX_ADDRECSRC;
- else if (strncmp(val, "remove", strlen(val)) == 0 || *val == '-')
+ else if (strncmp(val, "remove", strlen(val)) == 0 ||
+ strncmp(val, "-", strlen(val)) == 0)
opt = MIX_REMOVERECSRC;
- else if (strncmp(val, "set", strlen(val)) == 0 || *val == '=')
+ else if (strncmp(val, "set", strlen(val)) == 0 ||
+ strncmp(val, "=", strlen(val)) == 0)
opt = MIX_SETRECSRC;
- else if (strncmp(val, "toggle", strlen(val)) == 0 || *val == '^')
+ else if (strncmp(val, "toggle", strlen(val)) == 0 ||
+ strncmp(val, "^", strlen(val)) == 0)
opt = MIX_TOGGLERECSRC;
else {
warnx("%s: no such modifier", val);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 9:19 PM (20 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14746142
Default Alt Text
D45973.id141459.diff (1 KB)
Attached To
Mode
D45973: mixer(8): Make mute and recsrc argument parsing more robust
Attached
Detach File
Event Timeline
Log In to Comment