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:
parent
6b7c46afec
commit
f8f02928d3
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user