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/tools.c b/src/tools.c
index b5cc30e..803afab 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -2236,7 +2236,7 @@
len = len >> 1;
if (!*binstr) {
- *binstr = calloc(len, sizeof(char));
+ *binstr = calloc(len, sizeof(**binstr));
if (!*binstr) {
memprintf(err, "out of memory while loading string pattern");
return 0;