[PATCH v2 4/4] syntax-check: forbid usage of snprintf

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---

new in v2

 build-aux/syntax-check.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index ff1198ca73..78458dce53 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -469,6 +469,11 @@ sc_prohibit_sprintf:
 	halt='use g_snprintf, not sprintf' \
 	  $(_sc_search_regexp)
 
+sc_prohibit_snprintf:
+	@prohibit='\<snprintf\>' \
+	halt='use g_snprintf, not snprintf' \
+	  $(_sc_search_regexp)
+
 sc_prohibit_readlink:
 	@prohibit='\<readlink *\(' \
 	halt='use virFileResolveLink, not readlink' \
@@ -2264,6 +2269,9 @@ exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c|tools/virt-l
 exclude_file_name_regexp--sc_prohibit_sprintf = \
   ^(build-aux/syntax-check\.mk|docs/hacking\.html\.in|.*\.stp|.*\.pl)$$
 
+exclude_file_name_regexp--sc_prohibit_snprintf = \
+  ^(build-aux/syntax-check\.mk|docs/hacking\.html\.in|tools/virt-login-shell\.c)$$
+
 exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/virstring\.c$$
 
 exclude_file_name_regexp--sc_prohibit_strtol = ^examples/.*$$
-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux