DEV: coccinelle: Add rule to use `chunk_istcat()` instead of `chunk_memcat()`

This replaces `chunk_memcat()` with `chunk_istcat()` if the parameters are the
ist's `.ptr` and `.len`.
This commit is contained in:
Tim Duesterhus 2021-11-08 09:05:02 +01:00 committed by Willy Tarreau
parent 2471f5c2b2
commit 755d2419a4
1 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,14 @@ expression e;
- if (\(i.len\|istlen(i)\) > e) { i.len = e; }
+ i = isttrim(i, e);
@@
struct ist i;
struct buffer *b;
@@
- chunk_memcat(b, \(i.ptr\|istptr(i)\) , \(i.len\|istlen(i)\));
+ chunk_istcat(b, i);
@@
struct ist i;
@@