summaryrefslogtreecommitdiffstats
path: root/coccinelle/xsprintf.cocci
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2020-10-04 11:31:51 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2020-10-04 12:32:21 +0200
commitcb60571b31597441286d0dbde0ce179069bd45c5 (patch)
treea421ed3076c1a3201dc478d7615472243a52374d /coccinelle/xsprintf.cocci
parentcoccinelle: disable flags-set where it doesn't make sense (diff)
downloadsystemd-cb60571b31597441286d0dbde0ce179069bd45c5.tar.xz
systemd-cb60571b31597441286d0dbde0ce179069bd45c5.zip
coccinelle: skip the xsprintf transformation on man pages
since we don't expose xsprintf to users.
Diffstat (limited to 'coccinelle/xsprintf.cocci')
-rw-r--r--coccinelle/xsprintf.cocci3
1 files changed, 2 insertions, 1 deletions
diff --git a/coccinelle/xsprintf.cocci b/coccinelle/xsprintf.cocci
index 401216ad72..660a35e3f4 100644
--- a/coccinelle/xsprintf.cocci
+++ b/coccinelle/xsprintf.cocci
@@ -1,6 +1,7 @@
@@
+position p : script:python() { not p[0].file.startswith("man/") };
expression e, fmt;
expression list vaargs;
@@
-- snprintf(e, sizeof(e), fmt, vaargs);
+- snprintf@p(e, sizeof(e), fmt, vaargs);
+ xsprintf(e, fmt, vaargs);