From: Tim Duesterhus Date: Mon, 8 Nov 2021 08:05:03 +0000 (+0100) Subject: DEV: coccinelle: Add rule to use `chunk_istcat()` instead of `chunk_strncat()` X-Git-Tag: v2.5-dev14~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9656e48377a9e5359494bce6a413a9915c8f74b;p=thirdparty%2Fhaproxy.git 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`. --- diff --git a/dev/coccinelle/ist.cocci b/dev/coccinelle/ist.cocci index 4945141b25..680afbadee 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; @@