svn commit: r343937 - stable/12/usr.sbin/kbdcontrol
Stefan Esser
se at FreeBSD.org
Sat Feb 9 14:13:50 UTC 2019
Author: se
Date: Sat Feb 9 14:13:49 2019
New Revision: 343937
URL: https://svnweb.freebsd.org/changeset/base/343937
Log:
MFC r343339: Silence Clang Scan warning about use of unitialized variable.
The logic is changed to depend on actual "beep" parameters instead of on a
flag that may be set for invalid parameters.
An embedded literal escape character is replaced by "\e".
Modified:
stable/12/usr.sbin/kbdcontrol/kbdcontrol.c
Modified: stable/12/usr.sbin/kbdcontrol/kbdcontrol.c
==============================================================================
--- stable/12/usr.sbin/kbdcontrol/kbdcontrol.c Sat Feb 9 14:07:04 2019 (r343936)
+++ stable/12/usr.sbin/kbdcontrol/kbdcontrol.c Sat Feb 9 14:13:49 2019 (r343937)
@@ -961,6 +961,8 @@ set_bell_values(char *opt)
int bell, duration, pitch;
bell = 0;
+ duration = 0;
+ pitch = 0;
if (!strncmp(opt, "quiet.", 6)) {
bell = CONS_QUIET_BELL;
opt += 6;
@@ -991,8 +993,8 @@ badopt:
}
ioctl(0, CONS_BELLTYPE, &bell);
- if (!(bell & CONS_VISUAL_BELL))
- fprintf(stderr, "[=%d;%dB", pitch, duration);
+ if (duration > 0 && pitch > 0)
+ fprintf(stderr, "\e[=%d;%dB", pitch, duration);
}
static void
More information about the svn-src-stable-12
mailing list