mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
coccinelle: automatically switch some uses of memcpy() → mempcpy()
Inspired by #22520, let's add a coccinelle script that converts this automatically.
This commit is contained in:
13
coccinelle/mempcpy.cocci
Normal file
13
coccinelle/mempcpy.cocci
Normal file
@@ -0,0 +1,13 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
@@
|
||||
expression x, y, z;
|
||||
@@
|
||||
- memcpy(x, y, z);
|
||||
- x += z;
|
||||
+ x = mempcpy(x, y, z);
|
||||
@@
|
||||
expression x, y, z;
|
||||
@@
|
||||
- memcpy_safe(x, y, z);
|
||||
- x += z;
|
||||
+ x = mempcpy_safe(x, y, z);
|
||||
Reference in New Issue
Block a user