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/hlua.c b/src/hlua.c
index 1eac9d1..491bc93 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -7362,7 +7362,8 @@
}
/* Memory for arguments. */
- rule->arg.hlua_rule->args = calloc(fcn->nargs + 1, sizeof(char *));
+ rule->arg.hlua_rule->args = calloc(fcn->nargs + 1,
+ sizeof(*rule->arg.hlua_rule->args));
if (!rule->arg.hlua_rule->args) {
memprintf(err, "out of memory error");
return ACT_RET_PRS_ERR;