X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/2dac1735f0284a32d7bf85fe82b0da1a43e502ec..0cfde1d2b81d51e73e45e178cdce58e10dcda0a4:/latester/histogram.h diff --git a/latester/histogram.h b/latester/histogram.h index 4a9aade..64dcb22 100644 --- a/latester/histogram.h +++ b/latester/histogram.h @@ -23,8 +23,9 @@ int histogram_init(struct histogram *h, return -1; } -void histogram_add(struct histogram *h, unsigned value) +void histogram_add(struct histogram *h, int value) { + if (value < 0) value = 0; unsigned index = value / h->resolution; if (index >= h->allocated) index = h->allocated - 1;