cocci: allow xcalloc(1, size)
Allocating a pre-cleared single element is quite common and it is misleading to use CALLOC_ARRAY(); these allocations that would be affected without this change are not allocating an array. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ca56dadb4b
commit
1c57cc70ec
@ -92,7 +92,7 @@ expression n;
|
||||
@@
|
||||
type T;
|
||||
T *ptr;
|
||||
expression n;
|
||||
expression n != 1;
|
||||
@@
|
||||
- ptr = xcalloc(n, \( sizeof(*ptr) \| sizeof(T) \) )
|
||||
+ CALLOC_ARRAY(ptr, n)
|
||||
|
Loading…
Reference in New Issue
Block a user