From 9683559f511bd05ca4983c357a33bed5a6176dce Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 10 Apr 2014 20:19:43 +0100 Subject: [PATCH] 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. --- testing/cmd_1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/cmd_1.c b/testing/cmd_1.c index 4c5243d..f3861be 100644 --- a/testing/cmd_1.c +++ b/testing/cmd_1.c @@ -211,8 +211,10 @@ int test_cmd_write_fast_1chan(void) if(ret= num_bytes){ + go = 0; + } if(verbose)printf("write %d %d\n",ret,total); }