Commits

Sterling Camden  committed 7533dac

Avoid using undefined behavior for int decrement to insure that forever really does mean forever.

  • Participants
  • Parent commits 24bfd13

Comments (0)

Files changed (1)

     cpu_curr = malloc(state_size);
     getsysctl("kern.cp_times", cpu_prev, state_size);
 
-    for (;count; count--)	/* Negative = forever */
+    while ((count < 0) || count--)	/* Negative = forever */
     {
 	long *prev, *curr;
 	int first = 1;