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