undid some of my wrong changes to try and get analog out working again
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 17 May 2002 00:00:35 +0000 (00:00 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 17 May 2002 00:00:35 +0000 (00:00 +0000)
comedi/comedi_fops.c

index 033945f5682e046c69a55208488159e57e3f3920..5d6912600644faf53243a90bb8913d756d73c8e7 100644 (file)
@@ -1347,8 +1347,8 @@ static ssize_t comedi_write_v22(struct file *file,const char *buf,size_t nbytes,
 
                n=nbytes;
 
-               m = async->buf_int_ptr - async->buf_user_ptr;
-               if( m < 0 )
+               m = async->data_len + async->buf_int_count - async->buf_user_count;
+               if( async->buf_user_ptr + m > async->data_len )
                        m = async->data_len - async->buf_user_ptr;
 
                if(m < n) n = m;