]> Sergey Matveev's repositories - godwmstat.git/blobdiff - main.go
Fix Swap parse
[godwmstat.git] / 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 = ""