Commit acdc8737 authored by Daniel Salzman's avatar Daniel Salzman

stats: improve possible argument type mismatch (Coverity)

parent d2b4106d
......@@ -116,8 +116,8 @@ static void dump_modules(dump_ctx_t *ctx)
}
if (ctr->count == 1) {
// Simple counter.
DUMP_CTR(ctx->fd, level + 1, "%s", ctr->name,
ATOMIC_GET(ctr->counter));
uint64_t counter = ATOMIC_GET(ctr->counter);
DUMP_CTR(ctx->fd, level + 1, "%s", ctr->name, counter);
} else {
// Array of counters.
DUMP_STR(ctx->fd, level + 1, "%s", ctr->name, "");
......
......@@ -1038,8 +1038,8 @@ static int send_stats_ctr(mod_ctr_t *ctr, ctl_args_t *args, knot_ctl_data_t *dat
char value[32];
if (ctr->count == 1) {
int ret = snprintf(value, sizeof(value), "%"PRIu64,
ATOMIC_GET(ctr->counter));
uint64_t counter = ATOMIC_GET(ctr->counter);
int ret = snprintf(value, sizeof(value), "%"PRIu64, counter);
if (ret <= 0 || ret >= sizeof(value)) {
return KNOT_ESPACE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment