From b06cecc1516910dc9486d2a74f0a2777a6b35791 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 17 Feb 2010 18:28:15 +0000 Subject: [PATCH] comedi_find_range() should skip ranges that don't match specified units. --- lib/range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/range.c b/lib/range.c index 361ac68..d3f74be 100644 --- a/lib/range.c +++ b/lib/range.c @@ -111,7 +111,7 @@ int _comedi_find_range(comedi_t *it,unsigned int subd,unsigned int chan,unsigned best_ptr=NULL; for(i=0;imin<=min && range_ptr->max>=max){ + if(range_ptr->unit==unit && range_ptr->min<=min && range_ptr->max>=max){ if(best<0 || (range_ptr->max-range_ptr->min) < (best_ptr->max-best_ptr->min)){ best=i; -- 2.26.2