]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
cmds: Format with contrib/format.sh
authorFlorian Forster <octo@google.com>
Fri, 17 Jul 2020 16:07:40 +0000 (18:07 +0200)
committerFlorian Forster <octo@google.com>
Wed, 29 Jul 2020 11:40:54 +0000 (13:40 +0200)
src/utils/cmds/flush.c

index 0259954519ac60140ffdb0c9761caad14ff01fef..21746c908e3645578228c5b83cf1062d0dbd8e6c 100644 (file)
@@ -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;
         }