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 <bruce.richardson@intel.com>
This commit is contained in:
Bruce Richardson 2019-04-03 15:45:02 +01:00 committed by Thomas Monjalon
parent f4206d1642
commit a5df16c1f7

View File

@ -1,6 +1,5 @@
@use_strlcpy@
identifier src, dst;
expression size;
expression src, dst, size;
@@
(
- snprintf(dst, size, "%s", src)