summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-01-01 23:13:19 +0000
committerNick Mathewson <nickm@torproject.org>2006-01-01 23:13:19 +0000
commit0da20696436399c05814022a1b7ebd4206605a37 (patch)
treed79034e06eb2e35adad6727647785d422ce75f0f /src/common/util.c
parent04db9de8474a07ecabfdc34f4715f54ff2c630dc (diff)
downloadtor-0da20696436399c05814022a1b7ebd4206605a37.tar.gz
tor-0da20696436399c05814022a1b7ebd4206605a37.zip
Clearner fix for timegm assert problem.
svn:r5690
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 28dd3938f3..5ef705f4fc 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -648,11 +648,8 @@ tor_timegm(struct tm *tm)
year = tm->tm_year + 1900;
if (year < 1970 || tm->tm_mon < 0 || tm->tm_mon > 11) {
warn(LD_BUG, "Out-of-range argument to tor_timegm");
- return 0;
+ return -1;
}
- tor_assert(year >= 1970);
- tor_assert(tm->tm_mon >= 0);
- tor_assert(tm->tm_mon <= 11);
days = 365 * (year-1970) + n_leapdays(1970,year);
for (i = 0; i < tm->tm_mon; ++i)
days += days_per_month[i];