mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
core: don't hit an assert when printing status messages about units with overly long description strings
This essentially reverts one part of d054f0a4d4
.
(We might also choose to use proper ellipsation here, but I wasn't sure the
memory allocation this requires wouöld be a good idea here...)
Fixes: #4534
This commit is contained in:
parent
0cc6064c3c
commit
07ecca0dc9
@ -767,8 +767,9 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) {
|
|||||||
if (!format)
|
if (!format)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* The description might be longer than the buffer, but that's OK, we'll just truncate it here */
|
||||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||||
xsprintf(buf, format, unit_description(u));
|
snprintf(buf, sizeof(buf), format, unit_description(u));
|
||||||
REENABLE_WARNING;
|
REENABLE_WARNING;
|
||||||
|
|
||||||
switch (t) {
|
switch (t) {
|
||||||
|
Loading…
Reference in New Issue
Block a user