Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151654386
D50397.id155627.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
969 B
Referenced Files
None
Subscribers
None
D50397.id155627.diff
View Options
diff --git a/usr.sbin/sndctl/sndctl.c b/usr.sbin/sndctl/sndctl.c
--- a/usr.sbin/sndctl/sndctl.c
+++ b/usr.sbin/sndctl/sndctl.c
@@ -662,12 +662,11 @@
sysctl_int(const char *buf, const char *arg, int *var)
{
size_t size;
- const char *val = arg;
int n, prev;
- n = strtol(val, NULL, 10);
+ n = strtol(arg, NULL, 10);
if (errno == EINVAL || errno == ERANGE) {
- warn("strtol(%s)", val);
+ warn("strtol(%s)", arg);
return (-1);
}
@@ -699,7 +698,6 @@
sysctl_str(const char *buf, const char *arg, char *var, size_t varsz)
{
size_t size;
- const char *val = arg;
char prev[BUFSIZ];
char *tmp;
@@ -710,10 +708,10 @@
return (-1);
}
- size = strlen(val);
+ size = strlen(arg);
/* Apply new value. */
- if (sysctlbyname(buf, NULL, 0, val, size) < 0) {
- warn("sysctlbyname(%s, %s)", buf, val);
+ if (sysctlbyname(buf, NULL, 0, arg, size) < 0) {
+ warn("sysctlbyname(%s, %s)", buf, arg);
return (-1);
}
/* Get size of new string. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 7:30 PM (6 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31241389
Default Alt Text
D50397.id155627.diff (969 B)
Attached To
Mode
D50397: sndctl(8): Remove unnecessary val variable from sysctl functions
Attached
Detach File
Event Timeline
Log In to Comment