[or-cvs] Clearner fix for timegm assert problem.
Nick Mathewson
nickm at seul.org
Sun Jan 1 23:13:21 UTC 2006
Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv7572/src/common
Modified Files:
util.c
Log Message:
Clearner fix for timegm assert problem.
Index: util.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.c,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -p -d -r1.241 -r1.242
--- util.c 1 Jan 2006 23:09:19 -0000 1.241
+++ util.c 1 Jan 2006 23:13:19 -0000 1.242
@@ -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];
More information about the tor-commits
mailing list