diff options
author | Simo Sorce <idra@samba.org> | 2003-10-12 20:48:30 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2003-10-12 20:48:30 +0000 |
commit | 3a26c9f37f4cfa296de3bb23b97c27e5b20989f7 (patch) | |
tree | 2778917b99650544e6c18eb16f2b00e78e7d8356 /source3 | |
parent | 50e95177b29b81ea45dbe94141138c323615e2bf (diff) | |
download | samba-3a26c9f37f4cfa296de3bb23b97c27e5b20989f7.tar.gz samba-3a26c9f37f4cfa296de3bb23b97c27e5b20989f7.tar.bz2 samba-3a26c9f37f4cfa296de3bb23b97c27e5b20989f7.zip |
make nt-time <-> unix-time functions nearly reversible
(This used to be commit 98d60dc1c7027a50f720933eb8d6ffbfb4276fa5)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/time.c | 7 |
1 files changed, 5 insertions, 2 deletions
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); |