From 854dbca744227e9896fb8a5fa8e9cb265182825c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 10 Mar 2020 19:11:26 +0100 Subject: [PATCH] formatting: no braces for single statement if/then/else branches --- lib/formats/iotagent_ul.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/formats/iotagent_ul.cpp b/lib/formats/iotagent_ul.cpp index d9def2f3c..bb69c42fb 100644 --- a/lib/formats/iotagent_ul.cpp +++ b/lib/formats/iotagent_ul.cpp @@ -44,18 +44,17 @@ int iotagent_ul_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, str if (!sig) return -1; - if (sig->name) { + if (sig->name) printed += snprintf(buf + printed, len - printed, "%s|%f|", sig->name, smp->data[i].f); - } else { + else { char name[32]; snprintf(name, 32, "signal_%d", i); printed += snprintf(buf + printed, len - printed, "%s|%f|", name, smp->data[i].f); } } - if (wbytes) { + if (wbytes) *wbytes = printed - 1; // -1 to cut off last '|' - } return 0; }