From 22ee326192295d9cd3afc7f556fd20173930034f Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 1 Aug 2022 12:28:59 +0200 Subject: [PATCH] logger: drop trailing space when reading message from command line Signed-off-by: Joachim Wiberg --- src/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logger.c b/src/logger.c index bf91c5f..67921d1 100644 --- a/src/logger.c +++ b/src/logger.c @@ -383,7 +383,7 @@ int main(int argc, char *argv[]) while (optind < argc) { size_t bytes; - bytes = snprintf(&buf[pos], len, "%s ", argv[optind++]); + bytes = snprintf(&buf[pos], len, "%s%s", pos ? " " : "", argv[optind++]); pos += bytes; len -= bytes; }