chiark / gitweb /
bootchart: Do not try to access data for non-existing CPU's
[elogind.git] / src / bootchart / store.c
index 3099ff12083a8271df27ad24c4b646c037c404fd..9ea1b27de4b1666614170b91d55a8f212bb4ca11 100644 (file)
@@ -199,7 +199,7 @@ vmstat_next:
 
                 if (strstr(key, "cpu")) {
                         r = safe_atoi((const char*)(key+3), &c);
-                        if (r < 0 || c > MAXCPUS)
+                        if (r < 0 || c > MAXCPUS -1)
                                 /* Oops, we only have room for MAXCPUS data */
                                 break;
                         sampledata->runtime[c] = atoll(rt);