1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
systemd/coccinelle/memzero.cocci
Lennart Poettering 673192494c coccinelle: automatically rewrite memset() to zero() or memzero() where we can
We are pretty good at this already, hence only a single case is actually
found by this.
2017-12-14 19:47:46 +01:00

31 lines
332 B
Plaintext

@@
expression s;
@@
- memset(&s, 0, sizeof(s))
+ zero(s)
@@
expression s;
@@
- memset(s, 0, sizeof(*s))
+ zero(*s)
@@
expression s;
@@
- bzero(&s, sizeof(s))
+ zero(s)
@@
expression s;
@@
- bzero(s, sizeof(*s))
+ zero(*s)
@@
expression a, b;
@@
- memset(a, 0, b)
+ memzero(a, b)
@@
expression a, b;
@@
- bzero(a, b)
+ memzero(a, b)