summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-08-24 21:37:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:50 -0500
commitb3773240504f12788908ca4755602d55842dded0 (patch)
tree8cb2dc4108525cfb1db67b8c3ddf896ce846fb82 /source3
parent08b63552bef1dca9f001182c7962c82bd0bd7cc2 (diff)
downloadsamba-b3773240504f12788908ca4755602d55842dded0.tar.gz
samba-b3773240504f12788908ca4755602d55842dded0.tar.bz2
samba-b3773240504f12788908ca4755602d55842dded0.zip
r17812: Fix bad unsigned comparisons with TIME_T_MIN/TIME_T_MAX.
Jeremy. (This used to be commit bd1fbdfb824883060b02be969a10f999d387973f)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/time.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index d7f796ca16..7d8f79b14a 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -235,13 +235,13 @@ static struct timespec nt_time_to_unix_timespec(NTTIME *nt)
/* Now adjust by 369 years to make the secs since 1970 */
d -= TIME_FIXUP_CONSTANT_INT;
- if (d <= TIME_T_MIN) {
+ if (((time_t)d) <= TIME_T_MIN) {
ret.tv_sec = TIME_T_MIN;
ret.tv_nsec = 0;
return ret;
}
- if (d >= TIME_T_MAX) {
+ if (((time_t)d) >= TIME_T_MAX) {
ret.tv_sec = TIME_T_MAX;
ret.tv_nsec = 0;
return ret;
@@ -283,7 +283,7 @@ time_t nt_time_to_unix_abs(const NTTIME *nt)
d += 1000*1000*10/2;
d /= 1000*1000*10;
- if (!(TIME_T_MIN <= d && d <= TIME_T_MAX)) {
+ if (!(TIME_T_MIN <= ((time_t)d) && ((time_t)d) <= TIME_T_MAX)) {
return (time_t)0;
}