+// SPDX-License-Identifier: ISC
/*
* Copyright (c) 2019 David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
if (flags & TIMEFMT_SKIP)
return 0;
+ if (!ts)
+ return bputch(buf, '-');
if (flags & TIMEFMT_REALTIME)
*real_ts = *ts;
if (flags & TIMEFMT_SKIP)
return 0;
+ if (!ts)
+ return bputch(buf, '-');
if (flags & TIMEFMT_ABSOLUTE) {
struct timespec anchor[1];
{
const struct timespec *ts = vptr;
- if (!ts)
- return bputs(buf, "(null)");
return printfrr_time(buf, ea, ts, 0);
}
struct timespec ts;
if (!tv)
- return bputs(buf, "(null)");
+ return printfrr_time(buf, ea, NULL, 0);
ts.tv_sec = tv->tv_sec;
ts.tv_nsec = tv->tv_usec * 1000;
struct timespec ts;
if (!tt)
- return bputs(buf, "(null)");
+ return printfrr_time(buf, ea, NULL, TIMEFMT_SECONDS);
ts.tv_sec = *tt;
ts.tv_nsec = 0;