Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Make clang -Wformat-security happier by not passi...



details:   https://anonhg.NetBSD.org/src/rev/2a4ffde07afc
branches:  trunk
changeset: 454688:2a4ffde07afc
user:      maya <maya%NetBSD.org@localhost>
date:      Wed Sep 25 15:51:37 2019 +0000

description:
Make clang -Wformat-security happier by not passing a (constant) variable
as the format string,
    const string msg; printf(msg)
      -> printf("%s", msg);

the strings are all known and don't currently contain format variables.

diffstat:

 sys/dev/ic/isp_netbsd.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r b43b84d8f598 -r 2a4ffde07afc sys/dev/ic/isp_netbsd.c
--- a/sys/dev/ic/isp_netbsd.c   Wed Sep 25 09:53:37 2019 +0000
+++ b/sys/dev/ic/isp_netbsd.c   Wed Sep 25 15:51:37 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.94 2019/09/21 07:31:56 maxv Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.95 2019/09/25 15:51:37 maya Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.94 2019/09/21 07:31:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.95 2019/09/25 15:51:37 maya Exp $");
 
 #include <dev/ic/isp_netbsd.h>
 #include <dev/ic/isp_ioctl.h>
@@ -1261,7 +1261,7 @@
                                   "Starting Loop Down Timer");
                        }
                }
-               isp_prt(isp, ISP_LOGINFO, msg);
+               isp_prt(isp, ISP_LOGINFO, "%s", msg);
                break;
         case ISPASYNC_LOOP_UP:
                /*
@@ -1457,7 +1457,7 @@
                        isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
                           "Stopping Loop Down Timer");
                }
-               isp_prt(isp, ISP_LOGINFO, msg);
+               isp_prt(isp, ISP_LOGINFO, "%s", msg);
                /*
                 * We can set blocked here because we know it's now okay
                 * to try and run isp_fc_runstate (in order to build loop



Home | Main Index | Thread Index | Old Index