diff options
author | teor <teor2345@gmail.com> | 2014-10-20 02:32:05 +1100 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2014-10-20 02:32:05 +1100 |
commit | dd556fb1e6002a0ca3c4560ecb8545696a82e0b9 (patch) | |
tree | 0116dc3702fcf3eea0d78232212d7c6124c8b318 /src | |
parent | fc5cab44724e8328e2186f22114625388f1c8f0d (diff) | |
download | tor-dd556fb1e6002a0ca3c4560ecb8545696a82e0b9.tar.gz tor-dd556fb1e6002a0ca3c4560ecb8545696a82e0b9.zip |
Use correct day of year in correct_tm()
Set the correct day of year value in correct_tm() when the
system's localtime(_r) or gmtime(_r) functions fail to set struct tm.
Fixes bug 13476.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/compat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 4dd04455a2..f8b1d15806 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2774,7 +2774,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf, r->tm_year = 8099; r->tm_mon = 11; r->tm_mday = 31; - r->tm_yday = 365; + r->tm_yday = 364; r->tm_hour = 23; r->tm_min = 59; r->tm_sec = 59; @@ -2791,7 +2791,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf, r->tm_year = 70; /* 1970 CE */ r->tm_mon = 0; r->tm_mday = 1; - r->tm_yday = 1; + r->tm_yday = 0; r->tm_hour = 0; r->tm_min = 0 ; r->tm_sec = 0; @@ -2804,7 +2804,7 @@ correct_tm(int islocal, const time_t *timep, struct tm *resultbuf, r->tm_year = 137; /* 2037 CE */ r->tm_mon = 11; r->tm_mday = 31; - r->tm_yday = 365; + r->tm_yday = 364; r->tm_hour = 23; r->tm_min = 59; r->tm_sec = 59; |