From bda64a11f7c11ca303122299c3e41c49e6afd933 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 12 Oct 2003 20:48:56 +0000 Subject: [PATCH] make nt-time <-> unix-time functions nearly reversible --- source/lib/time.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/lib/time.c b/source/lib/time.c index 5309711a056..74ca56bdc5c 100644 --- a/source/lib/time.c +++ b/source/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); -- 2.11.4.GIT