From 3a26c9f37f4cfa296de3bb23b97c27e5b20989f7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 12 Oct 2003 20:48:30 +0000 Subject: make nt-time <-> unix-time functions nearly reversible (This used to be commit 98d60dc1c7027a50f720933eb8d6ffbfb4276fa5) --- source3/lib/time.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/time.c b/source3/lib/time.c index 5309711a05..74ca56bdc5 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -318,8 +318,11 @@ time_t nt_time_to_unix(NTTIME *nt) /* now adjust by 369 years to make the secs since 1970 */ d -= TIME_FIXUP_CONSTANT; - if (!(l_time_min <= d && d <= l_time_max)) - return(0); + if (d <= l_time_min) + return (l_time_min); + + if (d >= l_time_max) + return (l_time_max); ret = (time_t)(d+0.5); -- cgit