Browse files

Fix for > 16 CPUs

  • Loading branch information...
1 parent cb65f49 commit 7be0a9eecf9b452517d6cfb64220959a01b6fbca @stovenator committed Jan 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/check_snmp_load.c
View
4 src/check_snmp_load.c
@@ -407,7 +407,7 @@ checkLoad (netsnmp_session * ss)
}
else if ((cpunbr % 10) == 0)
{
- load = realloc (load, cpunbr + 10 * sizeof (int));
+ load = realloc (load, (cpunbr + 10) * sizeof (int));

Oups, well spotted ... I wrote thoses plugins back in 2006 and you are the first to notice this bug, many thanks !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
load[cpunbr++] = (*(vars->val).integer);
@@ -511,7 +511,7 @@ check_and_print (int cpunbr)
average += load[count];
if (verbose)
{
- printf ("Cpu n°%d load=%d%% \n", count, load[count]);
+ printf ("Cpu n%d load=%d%% \n", count, load[count]);
}
}
average /= cpunbr;

0 comments on commit 7be0a9e

Please sign in to comment.