mirror of
https://git.proxmox.com/git/systemd
synced 2026-01-24 16:31:05 +00:00
util: when formatting timestamps return '0' for 0 timestamps instead of empty string
This commit is contained in:
parent
c593cfe164
commit
4502d22cb8
@ -1936,6 +1936,12 @@ char *format_timespan(char *buf, size_t l, usec_t t) {
|
||||
if (t == (usec_t) -1)
|
||||
return NULL;
|
||||
|
||||
if (t == 0) {
|
||||
snprintf(p, l, "0");
|
||||
p[l-1] = 0;
|
||||
return p;
|
||||
}
|
||||
|
||||
/* The result of this function can be parsed with parse_usec */
|
||||
|
||||
for (i = 0; i < ELEMENTSOF(table); i++) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user