[dpdk-dev] replacing snprintf with strlcpy where possible

Stephen Hemminger stephen at networkplumber.org
Sat Mar 9 01:48:51 CET 2019


If someone is familiar with coccinelle it should be possible to replace
all uses of:
	snprintf(buf, sizeof(buf), "%s", foo);
with:
	strlcpy(buf, foo, sizeof(buf));
using semantic patch

$ git grep snprintf | grep '"%s"' | grep -v ' = ' | wc -l
114

This could go on the cleanup dpdk-newbies list if there was one.


More information about the dev mailing list