CLEANUP: Do not use a fixed type for 'sizeof' in 'calloc'
Changes performed using the following coccinelle patch:
@@
type T;
expression E;
expression t;
@@
(
t = calloc(E, sizeof(*t))
|
- t = calloc(E, sizeof(T))
+ t = calloc(E, sizeof(*t))
)
Looking through the commit history, grepping for coccinelle shows that the same
replacement with a different patch was already performed in the past in commit
02779b6263a177b1e462e53db6eaf57bcda574bc.
diff --git a/src/check.c b/src/check.c
index c9802a6..4d6b75b 100644
--- a/src/check.c
+++ b/src/check.c
@@ -968,8 +968,8 @@
b_reset(&check->bi); check->bi.size = global.tune.chksize;
b_reset(&check->bo); check->bo.size = global.tune.chksize;
- check->bi.area = calloc(check->bi.size, sizeof(char));
- check->bo.area = calloc(check->bo.size, sizeof(char));
+ check->bi.area = calloc(check->bi.size, sizeof(*check->bi.area));
+ check->bo.area = calloc(check->bo.size, sizeof(*check->bo.area));
if (!check->bi.area || !check->bo.area)
return "out of memory while allocating check buffer";