From: Sergey Matveev Date: Sun, 28 Apr 2024 15:20:10 +0000 (+0300) Subject: Fix possibly negative integer X-Git-Tag: v3.0.0~8 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3d2cd5fa404fe5ea8d5fe9e7ef8fd02cab59bb12b5adae294f772cdeda0d7b63;p=vors.git Fix possibly negative integer --- diff --git a/cmd/client/stats.go b/cmd/client/stats.go index 8a5169b..3e29d70 100644 --- a/cmd/client/stats.go +++ b/cmd/client/stats.go @@ -96,6 +96,9 @@ func statsDrawer(stats *Stats, name string) { maxRMS = vol / 4 } rep = int(float64(GUIMaxY) * vol / maxRMS) + if rep < 0 { + rep = 0 + } v.Write([]byte(strings.Repeat("▒", rep))) } }