From a1e0a0e9286fbe90ca04cda9df38e72d8d18b0c1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 14 Jun 2006 21:36:49 +0000 Subject: r16230: Fix Klocwork #861 and others. localtime and asctime can return NULL. Ensure we check all returns correctly. Jeremy. (This used to be commit 6c61dc8ed6d84f310ef391fb7700e93ef42c4afc) --- source3/utils/status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/utils/status.c') diff --git a/source3/utils/status.c b/source3/utils/status.c index 05075da444..2566c8a50d 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -155,7 +155,7 @@ static void print_share_mode(const struct share_mode_entry *e, const char *share d_printf("NONE "); } - d_printf(" %s %s %s",sharepath, fname, asctime(localtime((time_t *)&e->time.tv_sec))); + d_printf(" %s %s %s",sharepath, fname, time_to_asc((time_t *)&e->time.tv_sec)); } } @@ -562,7 +562,7 @@ static int traverse_fn1(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *st d_printf("%-10s %s %-12s %s", crec.name,procid_str_static(&crec.pid), crec.machine, - asctime(localtime(&crec.start))); + time_to_asc(&crec.start)); return 0; } -- cgit