From a5df16c1f7e859823ff2b5461bea334b70035a19 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Wed, 3 Apr 2019 15:45:02 +0100 Subject: [PATCH] devtools/cocci: make strlcpy replacement smarter The original coccinelle script worked by replacing instances of snprintf(.."%s",...) with strlcpy(), but only where the source and dest parameters were plain identifiers. Allowing expressions for those params opens up a wide range of other possible changes. Signed-off-by: Bruce Richardson --- devtools/cocci/strlcpy.cocci | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devtools/cocci/strlcpy.cocci b/devtools/cocci/strlcpy.cocci index 335e271282..6f6beb6970 100644 --- a/devtools/cocci/strlcpy.cocci +++ b/devtools/cocci/strlcpy.cocci @@ -1,6 +1,5 @@ @use_strlcpy@ -identifier src, dst; -expression size; +expression src, dst, size; @@ ( - snprintf(dst, size, "%s", src) -- 2.20.1