From 8dc67be0f1c7cab9a8715e63593ffe6ccf297222 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Tue, 13 Nov 2007 12:38:00 +0200 Subject: fs-tests: fix bug in integrity test Signed-off-by: Adrian Hunter --- tests/fs-tests/integrity/integck.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/fs-tests') diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c index e64af9d..517c46d 100644 --- a/tests/fs-tests/integrity/integck.c +++ b/tests/fs-tests/integrity/integck.c @@ -490,9 +490,10 @@ static size_t file_write_data( struct file_info *file, written = BUFFER_SIZE; while (remains) { /* Fill up buffer with random data */ - if (written < BUFFER_SIZE) + if (written < BUFFER_SIZE) { memmove(buf, buf + written, BUFFER_SIZE - written); - else + written = BUFFER_SIZE - written; + } else written = 0; for (; written < BUFFER_SIZE; ++written) buf[written] = rand(); -- cgit v1.2.3