diff options
author | Simo Sorce <idra@samba.org> | 2003-10-12 20:48:56 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2003-10-12 20:48:56 +0000 |
commit | a98fc57af90be19f8449e0d0df4059eeaff4e2c8 (patch) | |
tree | 6e27cd04d1ccb98106b37cc2bb867947b82353f8 | |
parent | 0ed073259b82ecf49dfcbd1d15b65722adcaf61a (diff) | |
download | samba-a98fc57af90be19f8449e0d0df4059eeaff4e2c8.tar.gz samba-a98fc57af90be19f8449e0d0df4059eeaff4e2c8.tar.bz2 samba-a98fc57af90be19f8449e0d0df4059eeaff4e2c8.zip |
make nt-time <-> unix-time functions nearly reversible
(This used to be commit bda64a11f7c11ca303122299c3e41c49e6afd933)
-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); |