Cpu's are assigned normally, so starting at 0, so the MAX_CPU index will
always be one smaller than the actual number.
Found with Coverity.
if (strstr(key, "cpu")) {
r = safe_atoi((const char*)(key+3), &c);
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);
/* Oops, we only have room for MAXCPUS data */
break;
sampledata->runtime[c] = atoll(rt);