btstack/tool/misc/replace_malloc_plus_memset_by_calloc.cocci

13 lines
154 B
Plaintext
Raw Normal View History

2016-04-10 19:53:56 +00:00
@@
expression size, src;
@@
- src = malloc(size)
+ src = calloc(size)
...
- memset(src, 0, size);
@@
expression size;
@@
- calloc(size)
+ calloc(size, 1)