]> Sergey Matveev's repositories - vors.git/commitdiff
Fix possibly negative integer
authorSergey Matveev <stargrave@stargrave.org>
Sun, 28 Apr 2024 15:20:10 +0000 (18:20 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 29 Apr 2024 11:28:12 +0000 (14:28 +0300)
cmd/client/stats.go

index 8a5169bedad4f3c510e65d646c78878f7097c7b01c2af755491c6f6f01250af5..3e29d701469d9047b130ee6caa3f6c5475214d67237a998b6bb315d58bcae065 100644 (file)
@@ -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)))
                        }
                }