From: Ian Abbott Date: Wed, 17 Feb 2010 18:28:15 +0000 (+0000) Subject: comedi_find_range() should skip ranges that don't match specified units. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b06cecc1516910dc9486d2a74f0a2777a6b35791;p=comedilib.git comedi_find_range() should skip ranges that don't match specified units. --- 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;