if (strcasestr(arg2, "_group") != NULL) {
- if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_CM_STAT_ENTRIES
- || toIdx > NUM_CM_STAT_ENTRIES)
+ if (fromIdx < 0 || toIdx < 0 || fromIdx >= NUM_CM_STAT_ENTRIES
+ || toIdx >= NUM_CM_STAT_ENTRIES)
return (-10);
for (j = fromIdx; j <= toIdx; j++) {
if (!cm_showFlags[j]) {
cm_DisplayItems_count++;
cm_showFlags[j] = 1;
}
- if (cm_DisplayItems_count > NUM_CM_STAT_ENTRIES) {
+ if (cm_DisplayItems_count >= NUM_CM_STAT_ENTRIES) {
fprintf(stderr, "[ %s ] cm_DisplayItems_count ovf\n", rn);
return (-11);
}
if (strcasestr(catName, "_group") != NULL) {
if (fromIdx < 0 || toIdx < 0
- || fromIdx > NUM_CM_STAT_ENTRIES
- || toIdx > NUM_CM_STAT_ENTRIES)
+ || fromIdx >= NUM_CM_STAT_ENTRIES
+ || toIdx >= NUM_CM_STAT_ENTRIES)
return (-12);
for (j = fromIdx; j <= toIdx; j++) {
if (!cm_showFlags[j]) {
cm_DisplayItems_count++;
cm_showFlags[j] = 1;
}
- if (cm_DisplayItems_count > NUM_CM_STAT_ENTRIES) {
+ if (cm_DisplayItems_count >= NUM_CM_STAT_ENTRIES) {
fprintf(stderr,
"[ %s ] cm_DisplayItems_count ovf\n", rn);
return (-13);