summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-03-03 06:36:42 -0600
committerSean E. Russell <ser@ser1.net>2020-03-03 14:19:37 -0600
commitffbd8828dc290f7ac58281ea25174f5392605ec0 (patch)
tree63bddd72a2d60808b600a99fdc86e3a34263a1b5 /devices
parent20a90672d6dc2ddf10b418deb627c7e4079cd58c (diff)
Prevent crashes on Windows from wonky CPU values #70
Diffstat (limited to 'devices')
-rw-r--r--devices/cpu_cpu.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/devices/cpu_cpu.go b/devices/cpu_cpu.go
index a1d20cd..42eff2e 100644
--- a/devices/cpu_cpu.go
+++ b/devices/cpu_cpu.go
@@ -23,7 +23,11 @@ func init() {
}
for i := 0; i < len(vals); i++ {
key := fmt.Sprintf(formatString, i)
- cpus[key] = int(vals[i])
+ v := vals[i]
+ if v > 100 {
+ v = 100
+ }
+ cpus[key] = int(v)
}
return nil
}