From 7615e86fae8b0628378e8008d3bf1937e1cf103c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 12 Jul 2019 15:27:06 +0200 Subject: [PATCH] Add spatch to replace memcpy usage with memmove --- cocci/memcpy.spatch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cocci/memcpy.spatch diff --git a/cocci/memcpy.spatch b/cocci/memcpy.spatch new file mode 100644 index 0000000000..f5e50e7142 --- /dev/null +++ b/cocci/memcpy.spatch @@ -0,0 +1,14 @@ +@has_string_h@ +@@ + +#include + +@depends on has_string_h@ + +expression D; +expression S; +expression N; +@@ + +- memcpy(D, S, N); ++ memmove(D, S, N);