commit: 0a9a4c6f6942417fe26a8ce2d457ed340b4098dd Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Thu Apr 30 22:59:36 2020 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Thu Apr 30 22:59:36 2020 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=0a9a4c6f
probe-mirmon: ensure valid return from munge Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> probe-mirmon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/probe-mirmon b/probe-mirmon index b0c3413..ff73776 100755 --- a/probe-mirmon +++ b/probe-mirmon @@ -112,6 +112,8 @@ sub munge_date { if($timestamp >= $year2020 && $timestamp <= $year2038) { return $timestamp; } else { - return Date::Parse::str2time($timestr); + my $timestamp = Date::Parse::str2time($timestr); + return $timestamp if defined($timestamp); } + return -1; }