From cf0efae0cb1d8129bfff8af89048e67e93bcfff3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 2 Feb 2018 00:13:10 +0000 Subject: cosmetic fix: print unchanged line instead of nonsense when s6-tai64nlocal can't convert time --- src/daemontools-extras/s6-tai64nlocal.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/daemontools-extras/s6-tai64nlocal.c b/src/daemontools-extras/s6-tai64nlocal.c index ce97470..7084abd 100644 --- a/src/daemontools-extras/s6-tai64nlocal.c +++ b/src/daemontools-extras/s6-tai64nlocal.c @@ -27,13 +27,15 @@ int main (void) p = timestamp_scan(satmp.s, &a) ; if (p) { - char fmt[LOCALTMN_FMT+1] ; localtmn_t local ; - size_t len ; - localtmn_from_tain(&local, &a, 1) ; - len = localtmn_fmt(fmt, &local) ; - if (buffer_put(buffer_1, fmt, len) < (ssize_t)len) - strerr_diefu1sys(111, "write to stdout") ; + if (localtmn_from_tain(&local, &a, 1)) + { + char fmt[LOCALTMN_FMT+1] ; + size_t len = localtmn_fmt(fmt, &local) ; + if (buffer_put(buffer_1, fmt, len) < (ssize_t)len) + strerr_diefu1sys(111, "write to stdout") ; + } + else p = 0 ; } } if (buffer_put(buffer_1, satmp.s + p, satmp.len - p) < (ssize_t)(satmp.len - p)) -- cgit v1.2.3