projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filecount plugin: malloc + memset -> calloc
[collectd.git]
/
src
/
utils_rrdcreate.c
diff --git
a/src/utils_rrdcreate.c
b/src/utils_rrdcreate.c
index
5add323
..
44c2386
100644
(file)
--- a/
src/utils_rrdcreate.c
+++ b/
src/utils_rrdcreate.c
@@
-62,7
+62,7
@@
static int rra_timespans[] =
};
static int rra_timespans_num = STATIC_ARRAY_SIZE (rra_timespans);
};
static int rra_timespans_num = STATIC_ARRAY_SIZE (rra_timespans);
-static c
har *
rra_types[] =
+static c
onst char *const
rra_types[] =
{
"AVERAGE",
"MIN",
{
"AVERAGE",
"MIN",
@@
-284,7
+284,7
@@
static int ds_get (char ***ret, /* {{{ */
const rrdcreate_config_t *cfg)
{
char **ds_def;
const rrdcreate_config_t *cfg)
{
char **ds_def;
-
in
t ds_num;
+
size_
t ds_num;
char min[32];
char max[32];
char min[32];
char max[32];
@@
-305,7
+305,7
@@
static int ds_get (char ***ret, /* {{{ */
for (ds_num = 0; ds_num < ds->ds_num; ds_num++)
{
data_source_t *d = ds->ds + ds_num;
for (ds_num = 0; ds_num < ds->ds_num; ds_num++)
{
data_source_t *d = ds->ds + ds_num;
- char *type;
+ c
onst c
har *type;
int status;
ds_def[ds_num] = NULL;
int status;
ds_def[ds_num] = NULL;
@@
-421,7
+421,7
@@
static int srrd_create (const char *filename, /* {{{ */
char last_up_str[16];
new_argc = 6 + argc;
char last_up_str[16];
new_argc = 6 + argc;
- new_argv =
(char **) malloc ((new_argc + 1) * sizeof (char *
));
+ new_argv =
malloc ((new_argc + 1) * sizeof (*new_argv
));
if (new_argv == NULL)
{
ERROR ("rrdtool plugin: malloc failed.");
if (new_argv == NULL)
{
ERROR ("rrdtool plugin: malloc failed.");
@@
-689,7
+689,7
@@
int cu_rrd_create_file (const char *filename, /* {{{ */
argc = ds_num + rra_num;
argc = ds_num + rra_num;
- if ((argv =
(char **) malloc (sizeof (char *
) * (argc + 1))) == NULL)
+ if ((argv =
malloc (sizeof (*argv
) * (argc + 1))) == NULL)
{
char errbuf[1024];
ERROR ("cu_rrd_create_file failed: %s",
{
char errbuf[1024];
ERROR ("cu_rrd_create_file failed: %s",