]> git.ipfire.org Git - thirdparty/util-linux.git/commit
logger: fix --size use for stdin
authorKarel Zak <kzak@redhat.com>
Thu, 21 Oct 2021 16:47:40 +0000 (18:47 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Oct 2021 16:47:40 +0000 (18:47 +0200)
commit58e4ee082bca100034791a4a74481f263bb30a25
treee6e907e9558f26ab39d72b975611089e06ff62b8
parent2a82207f064734c6fab7cd322c05a94738963cbb
logger: fix --size use for stdin

The stdin version counts log header into the message size, but
for example when it reads message from argv[] it counts only message
itself.

 $ logger --stderr  --size 3 "abcd"
 <13>Oct 21 18:48:29 kzak: abc

 $ echo "abcd" | logger --stderr  --size 3
 logger: cannot allocate 18446744073709551597 bytes: Cannot allocate memory

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2011602
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/logger.c