Fix Swap parse
authorSergey Matveev <stargrave@stargrave.org>
Thu, 21 Oct 2021 21:43:57 +0000 (00:43 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 21 Oct 2021 21:43:57 +0000 (00:43 +0300)
main.go

diff --git a/main.go b/main.go
index cce3909f50b279602ee989f0d7a1aed27222ff72..04cca53140ad7e44e005d908e465391a517ce1a2 100644 (file)
--- a/main.go
+++ b/main.go
@@ -76,7 +76,7 @@ func top() {
                case "ARC:":
                        ARC = cols[1]
                case "Swap:":
-                       if cols[4] == "Used," {
+                       if len(cols) >= 5 && cols[4] == "Used," {
                                Swap = cols[3] + " Swap "
                        } else {
                                Swap = ""