projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'pr/1393'
[collectd.git]
/
src
/
utils_db_query.c
diff --git
a/src/utils_db_query.c
b/src/utils_db_query.c
index
f29eabc
..
d2b8117
100644
(file)
--- a/
src/utils_db_query.c
+++ b/
src/utils_db_query.c
@@
-202,8
+202,9
@@
static int udb_result_submit (udb_result_t *r, /* {{{ */
assert (r != NULL);
assert (r_area->ds != NULL);
assert (((size_t) r_area->ds->ds_num) == r->values_num);
assert (r != NULL);
assert (r_area->ds != NULL);
assert (((size_t) r_area->ds->ds_num) == r->values_num);
+ assert (r->values_num > 0);
- vl.values = (value_t *) calloc (r
_area->ds->d
s_num, sizeof (value_t));
+ vl.values = (value_t *) calloc (r
->value
s_num, sizeof (value_t));
if (vl.values == NULL)
{
ERROR ("db query utils: malloc failed.");
if (vl.values == NULL)
{
ERROR ("db query utils: malloc failed.");
@@
-370,10
+371,10
@@
static int udb_result_prepare_result (udb_result_t const *r, /* {{{ */
BAIL_OUT (-1);
}
BAIL_OUT (-1);
}
- if (
((size_t) prep_area->ds->ds_num)
!= r->values_num)
+ if (
prep_area->ds->ds_num
!= r->values_num)
{
ERROR ("db query utils: udb_result_prepare_result: The type `%s' "
{
ERROR ("db query utils: udb_result_prepare_result: The type `%s' "
- "requires exactly %
i
value%s, but the configuration specifies %zu.",
+ "requires exactly %
zu
value%s, but the configuration specifies %zu.",
r->type,
prep_area->ds->ds_num, (prep_area->ds->ds_num == 1) ? "" : "s",
r->values_num);
r->type,
prep_area->ds->ds_num, (prep_area->ds->ds_num == 1) ? "" : "s",
r->values_num);