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 _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"