ext/date/lib/tm2unixtime.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c
index c058672..94e5254 100644
--- a/ext/date/lib/tm2unixtime.c
+++ b/ext/date/lib/tm2unixtime.c
@@ -334,9 +334,9 @@ static timelib_sll do_years(timelib_sll year)
static timelib_sll do_months(timelib_ull month, timelib_ull year)
{
if (timelib_is_leap(year)) {
-
return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY);
-
} else {return (((timelib_ull)month_tab_leap[month - 1] + 1) * SECS_PER_DAY);
-
return ((month_tab[month - 1]) * SECS_PER_DAY);
-
}return (((timelib_ull)month_tab[month - 1]) * SECS_PER_DAY);
}
@@ -361,7 +361,7 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
case TIMELIB_ZONETYPE_OFFSET:
tz->is_localtime = 1;
-
return tz->z * 60;
-
return (timelib_sll)tz->z * 60; break; case TIMELIB_ZONETYPE_ABBR: {
--
1.9.1
--
ext/date/lib/tm2unixtime.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Somebody please take a look at /ext/date/lib/parse_tz.c too:
438timelib_sll timelib_get_current_offset(timelib_time *t)
[..]
446 return (t->z + t->dst) * -60;
Should that be cast timelib_sll too?
I think perhaps the function should be an int, seeing as it looks like
the result should be negative. Somebody please check.
--
-- Joshua Rogers <https://internot.info/
Hi all,
--
ext/date/lib/tm2unixtime.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Somebody please take a look at /ext/date/lib/parse_tz.c too:438timelib_sll timelib_get_current_offset(timelib_time *t)
[..]
446 return (t->z + t->dst) * -60;
Should that be cast timelib_sll too?I think perhaps the function should be an int, seeing as it looks like
the result should be negative. Somebody please check.
I'm not familiar with timelib. Anyway, if you could send PR, it would be
nicer.
Or at least a bug report.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
--
ext/date/lib/tm2unixtime.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Somebody please take a look at /ext/date/lib/parse_tz.c too:438timelib_sll timelib_get_current_offset(timelib_time *t)
[..]
446 return (t->z + t->dst) * -60;
Should that be cast timelib_sll too?I think perhaps the function should be an int, seeing as it looks like
the result should be negative. Somebody please check.
The result can be either positive or negative as t->z can be both.
timelib_sll seems right though, as it stands for "long long signed".
I don't quite see how this can overflow though - as t->z and t->dst come
just close to 100000 (and it's internal provided data).
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine