]> git.ipfire.org Git - thirdparty/systemd.git/commit
job: truncate unit description
authorIago López Galeiras <iago@kinvolk.io>
Fri, 16 Feb 2018 13:32:44 +0000 (14:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 19 Feb 2018 11:37:30 +0000 (12:37 +0100)
commit574432f889ce3de126bbc6736bcbd22ee170ff82
treeb2dda4bd64dd87ee2ce55e869b25d7040a597ccf
parent9371f858a5c126ad17f52e9318f643456b6b6e4a
job: truncate unit description

The comment above says we're truncating the string but that's not true,
an assert will fail in xsprintf if the description is longer than
LINE_MAX.

Let's use snprintf instead of xsprintf to make sure it's truncated.
We'll cast its result to void to tell static checkers we're fine with
truncation.
src/core/job.c