]> xenbits.xensource.com Git - libvirt.git/commitdiff
syntax-check: forbid virBufferAsprintf with string literals
authorJán Tomko <jtomko@redhat.com>
Tue, 7 May 2013 11:42:40 +0000 (13:42 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 7 May 2013 15:49:59 +0000 (17:49 +0200)
cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 1d63bbd2b77033d92ecc66557f218a7bc814ea52..227c18b60196db8391c60353aa2075ebb4acc64f 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -490,6 +490,11 @@ sc_prohibit_virBufferAdd_with_string_literal:
        halt='use virBufferAddLit, not virBufferAdd, with a string literal' \
          $(_sc_search_regexp)
 
+sc_prohibit_virBufferAsprintf_with_string_literal:
+       @prohibit='\<virBufferAsprintf *\([^,]+, *"([^%"\]|\\.|%%)*"\)'         \
+       halt='use virBufferAddLit, not virBufferAsprintf, with a string literal' \
+         $(_sc_search_regexp)
+
 # Not only do they fail to deal well with ipv6, but the gethostby*
 # functions are also not thread-safe.
 sc_prohibit_gethostby: