logger: drop trailing space when reading message from command line

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2022-08-01 12:28:59 +02:00
parent 16bad57af5
commit 22ee326192

View File

@ -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;
}