btstack/tool/misc/replace_malloc_plus_memset_by_calloc.cocci
2016-04-10 21:53:56 +02:00

13 lines
154 B
Plaintext

@@
expression size, src;
@@
- src = malloc(size)
+ src = calloc(size)
...
- memset(src, 0, size);
@@
expression size;
@@
- calloc(size)
+ calloc(size, 1)