summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r--src/shared/time-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index b29d8c6e4e..55428c4ced 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -158,7 +158,7 @@ char *format_timestamp(char *buf, size_t l, usec_t t) {
assert(buf);
assert(l > 0);
- if (t <= 0)
+ if (t <= 0 || t == (usec_t) -1)
return NULL;
sec = (time_t) (t / USEC_PER_SEC);
@@ -176,7 +176,7 @@ char *format_timestamp_us(char *buf, size_t l, usec_t t) {
assert(buf);
assert(l > 0);
- if (t <= 0)
+ if (t <= 0 || t == (usec_t) -1)
return NULL;
sec = (time_t) (t / USEC_PER_SEC);