devtools/cocci: create safer version of strlcpy script
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 3 Apr 2019 14:45:03 +0000 (15:45 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 4 Apr 2019 20:45:33 +0000 (22:45 +0200)
commit277b6e7ef457729b88fe415dfd4a2184e5b329fb
treed38e1e30c67338b8234b220b92ab7826f05a1dfe
parenta5df16c1f7e859823ff2b5461bea334b70035a19
devtools/cocci: create safer version of strlcpy script

The existing cocci script for coccinelle replaces all matching instances
of snprintf() with strlcpy() without regards to header inclusion. To allow
changes without build errors, we create a safer version of this script
that only makes changes when the rte_string_fns.h header is already
included.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
devtools/cocci/strlcpy-with-header.cocci [new file with mode: 0644]