aboutsummaryrefslogtreecommitdiffstats
path: root/devtools/cocci
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/cocci')
-rw-r--r--devtools/cocci/strlcpy.cocci8
1 files changed, 8 insertions, 0 deletions
diff --git a/devtools/cocci/strlcpy.cocci b/devtools/cocci/strlcpy.cocci
new file mode 100644
index 00000000..335e2712
--- /dev/null
+++ b/devtools/cocci/strlcpy.cocci
@@ -0,0 +1,8 @@
+@use_strlcpy@
+identifier src, dst;
+expression size;
+@@
+(
+- snprintf(dst, size, "%s", src)
++ strlcpy(dst, src, size)
+)