From: Florian Forster Date: Fri, 17 Jul 2020 16:07:40 +0000 (+0200) Subject: cmds: Format with contrib/format.sh X-Git-Tag: 6.0.0-rc0~144^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28284aea9ccb590e4eb76f7f1cec1b6bf9383b90;p=thirdparty%2Fcollectd.git cmds: Format with contrib/format.sh --- diff --git a/src/utils/cmds/flush.c b/src/utils/cmds/flush.c index 025995451..21746c908 100644 --- a/src/utils/cmds/flush.c +++ b/src/utils/cmds/flush.c @@ -72,8 +72,8 @@ cmd_status_t cmd_parse_flush(size_t argc, char **argv, cmd_flush_t *ret_flush, ret_flush->identifiers = id; id = ret_flush->identifiers + ret_flush->identifiers_num; ret_flush->identifiers_num++; - if (parse_identifier(opt_value, &id->host, &id->plugin, - &id->type, &id->data_source, + if (parse_identifier(opt_value, &id->host, &id->plugin, &id->type, + &id->data_source, opts->identifier_default_host) != 0) { cmd_error(CMD_PARSE_ERROR, err, "Invalid identifier `%s'.", opt_value); cmd_destroy_flush(ret_flush); @@ -140,11 +140,12 @@ cmd_status_t cmd_handle_flush(FILE *fh, char *buffer) { if (cmd.cmd.flush.identifiers_num != 0) { identifier_t *id = cmd.cmd.flush.identifiers + j; - if (snprintf( - buf, sizeof(buf), "%s/%s/%s/%s", (id->host == NULL) ? "" : id->host, - (id->plugin == NULL) ? "" : id->plugin, - (id->type == NULL) ? "" : id->type, - (id->data_source == NULL) ? "" : id->data_source) > sizeof(buf)) { + if (snprintf(buf, sizeof(buf), "%s/%s/%s/%s", + (id->host == NULL) ? "" : id->host, + (id->plugin == NULL) ? "" : id->plugin, + (id->type == NULL) ? "" : id->type, + (id->data_source == NULL) ? "" : id->data_source) > + sizeof(buf)) { error++; continue; }