Add spatch to replace memcpy usage with memmove
This commit is contained in:
14
cocci/memcpy.spatch
Normal file
14
cocci/memcpy.spatch
Normal file
@@ -0,0 +1,14 @@
|
||||
@has_string_h@
|
||||
@@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@depends on has_string_h@
|
||||
|
||||
expression D;
|
||||
expression S;
|
||||
expression N;
|
||||
@@
|
||||
|
||||
- memcpy(D, S, N);
|
||||
+ memmove(D, S, N);
|
||||
Reference in New Issue
Block a user