comedi_test: fix test_cmd_write_fast_1chan() for big buffer

If the comedi data buffer is larger than the total size of the data
being written to the buffer in first test_cmd_write_fast_1chan(), the
first loop iterates endlessly writing 0 bytes to the buffer.  Break out
of the first loop once the required amount of data has been written.
This commit is contained in:
Ian Abbott 2014-04-10 20:19:43 +01:00
parent 207c72b0f9
commit 9683559f51

View file

@ -211,8 +211,10 @@ int test_cmd_write_fast_1chan(void)
if(ret<wc){
go = 0;
}
total += ret;
if(total >= num_bytes){
go = 0;
}
if(verbose)printf("write %d %d\n",ret,total);
}