From 074978be5ed1f2ee9ce787a154ce0cedfef0410d Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 16 Jun 2010 19:12:43 +0000 Subject: [PATCH] When total command count is very low, percentage values in command stats tab were miscalculated. Fixes issue #2015. --- source/main.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/main.pas b/source/main.pas index 91089e9a..93f136be 100644 --- a/source/main.pas +++ b/source/main.pas @@ -7909,8 +7909,8 @@ procedure TMainForm.ListCommandStatsBeforePaint(Sender: TBaseVirtualTree; Target tmpval := commandCount / Connection.ServerUptime; VTRowDataListCommandStats[idx].Captions.Add( FormatNumber( tmpval, 1 ) ); // Percentage. Take care of division by zero errors and Int64's - if commandCount < 1 then - commandCount := 1; + if commandCount < 0 then + commandCount := 0; if totalCount < 1 then totalCount := 1; tmpval := 100 / totalCount * commandCount;