1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

decimate: avoid floating point exception

This commit is contained in:
Steffen Vogel 2019-01-28 11:10:36 +01:00
parent 3c42811d8b
commit be5358254f

View file

@ -72,7 +72,7 @@ static int decimate_process(struct hook *h, struct sample *smps[], unsigned *cnt
int i, ok;
for (i = 0, ok = 0; i < *cnt; i++) {
if (p->counter++ % p->ratio == 0) {
if (p->ratio && p->counter++ % p->ratio == 0) {
struct sample *tmp;
tmp = smps[ok];