forked from systemd/systemd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coccinelle: automatically switch some uses of memcpy() → mempcpy()
Inspired by systemd#22520, let's add a coccinelle script that converts this automatically.
- Loading branch information
1 parent
bde335f
commit 96ca229
Showing
3 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters