From 96ca229517c65c7f47c02e21e9778ac189a829c1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 16 Feb 2022 10:52:51 +0100 Subject: =?UTF-8?q?coccinelle:=20automatically=20switch=20some=20uses=20of?= =?UTF-8?q?=20memcpy()=20=E2=86=92=20mempcpy()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inspired by #22520, let's add a coccinelle script that converts this automatically. --- coccinelle/mempcpy.cocci | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 coccinelle/mempcpy.cocci (limited to 'coccinelle') diff --git a/coccinelle/mempcpy.cocci b/coccinelle/mempcpy.cocci new file mode 100644 index 0000000000..efb657ae79 --- /dev/null +++ b/coccinelle/mempcpy.cocci @@ -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); -- cgit v1.2.1