]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coccinelle: skip the xsprintf transformation on man pages
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 4 Oct 2020 09:31:51 +0000 (11:31 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 4 Oct 2020 10:32:21 +0000 (12:32 +0200)
since we don't expose xsprintf to users.

coccinelle/xsprintf.cocci

index 401216ad728a431b6cef5227c5ac5123c60b31c7..660a35e3f4d9b340a5e90db9a1138ff44b8cf635 100644 (file)
@@ -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);