From b9656e48377a9e5359494bce6a413a9915c8f74b Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Mon, 8 Nov 2021 09:05:03 +0100 Subject: [PATCH] DEV: coccinelle: Add rule to use `chunk_istcat()` instead of `chunk_strncat()` This replaces `chunk_strncat()` with `chunk_istcat()` if the parameters are the ist's `.ptr` and `.len`. --- dev/coccinelle/ist.cocci | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 4945141b2..680afbade 100644 --- a/dev/coccinelle/ist.cocci +++ b/dev/coccinelle/ist.cocci @@ -60,6 +60,14 @@ struct buffer *b; - chunk_memcat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\)); + chunk_istcat(b, i); +@@ +struct ist i; +struct buffer *b; +@@ + +- chunk_strncat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\)); ++ chunk_istcat(b, i); + @@ struct ist i; @@