devtools/cocci: make strlcpy replacement smarter
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 3 Apr 2019 14:45:02 +0000 (15:45 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 4 Apr 2019 20:44:02 +0000 (22:44 +0200)
commita5df16c1f7e859823ff2b5461bea334b70035a19
treecf06c63932497a525e64973659ed21729dd0433c
parentf4206d16429cde8af71912be357bf3e1a3f2f315
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>
devtools/cocci/strlcpy.cocci