summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-05-04 10:49:35 +0000
committerAndrew Tridgell <tridge@samba.org>1996-05-04 10:49:35 +0000
commit8098025e2efa96c3b4b3fda59545ba6bc159e777 (patch)
tree48621dac4b630c7159bb8cc3ec82242566d59041 /source3/lib/util.c
parentb2a31c9e8118519b13c3625f6d1b46042bcb9501 (diff)
downloadsamba-8098025e2efa96c3b4b3fda59545ba6bc159e777.tar.gz
samba-8098025e2efa96c3b4b3fda59545ba6bc159e777.tar.bz2
samba-8098025e2efa96c3b4b3fda59545ba6bc159e777.zip
fix a dst bug, we had a sign wrong in the calculation :-(
(This used to be commit 2cf4d958f454465f05c54f865cb77fa5c4cc620a)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 7bd6298c4c..bc0edb15c1 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -464,12 +464,11 @@ int DSTDiff(time_t t)
table_size++;
- dst_table[i].is_dst = is_dst = (localtime(&t)->tm_isdst?True:False);;
+ dst_table[i].is_dst = is_dst = (localtime(&t)->tm_isdst?True:False);
dst_table[i].start = dst_table[i].end = t;
/* no entry will cover more than 6 months */
low = t - 3*30*24*60*60;
- high = t + 3*30*24*60*60;
/* widen the new entry using two bisection searches */
while (low+60*60 < dst_table[i].start) {
@@ -480,8 +479,9 @@ int DSTDiff(time_t t)
low = t;
}
+ high = low + 3*30*24*60*60;
while (high-60*60 > dst_table[i].end) {
- t = high + (high-dst_table[i].end)/2;
+ t = high - (high-dst_table[i].end)/2;
if ((localtime(&t)->tm_isdst?True:False) == is_dst)
dst_table[i].end = t;
else