[FFmpeg-devel] [PATCH] fateserver: prevent division by 0, and therefore 500 error
Timothy Gu
timothygu99 at gmail.com
Thu Mar 6 01:59:47 CET 2014
... when no fate data is present.
Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
---
history.cgi | 2 ++
index.cgi | 2 ++
2 files changed, 4 insertions(+)
diff --git a/history.cgi b/history.cgi
index b51d19c..b2ed52f 100755
--- a/history.cgi
+++ b/history.cgi
@@ -31,6 +31,8 @@ opendir D, $slotdir or fail "Slot $slot_escaped not found";
my @reps = grep { /^[0-9]/ and -d "$slotdir/$_" } readdir D;
close D;
+ at reps or fail "No data in $fatedir";
+
print "Content-type: text/html\r\n\r\n";
doctype;
diff --git a/index.cgi b/index.cgi
index 6c9c69c..d61a1ef 100755
--- a/index.cgi
+++ b/index.cgi
@@ -51,6 +51,8 @@ for my $slot (@slots) {
}
}
+ at reps or fail 'No data in $fatedir';
+
$allpass = 100 * $allpass / @reps;
$allfail = 100 * $allfail / @reps;
my $warn = 100 - $allpass - $allfail;
--
1.8.3.2
More information about the ffmpeg-devel
mailing list