From: Nick Mathewson Date: Sun, 1 Jan 2006 23:13:19 +0000 (+0000) Subject: Clearner fix for timegm assert problem. X-Git-Tag: tor-0.1.1.11-alpha~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0da20696436399c05814022a1b7ebd4206605a37;p=thirdparty%2Ftor.git Clearner fix for timegm assert problem. svn:r5690 --- 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];