Fix an off by one in ppsratecheck(). If you asked for N=1 you'd get one,

but for any N>1 you'd get N-1 packets/events per second.
This commit is contained in:
Ian Lepore 2015-01-11 20:48:29 +00:00
parent 6b7c46afec
commit f8f02928d3

View File

@ -982,7 +982,7 @@ ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps)
return (maxpps != 0);
} else {
(*curpps)++; /* NB: ignore potential overflow */
return (maxpps < 0 || *curpps < maxpps);
return (maxpps < 0 || *curpps <= maxpps);
}
}