From 629d240ec364c6006aee823bcf9f2f0c5bc5945e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 23 Apr 2024 12:20:00 +0200 Subject: [FUSE] Fix division by zero --- src/cowtest/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cowtest/main.c b/src/cowtest/main.c index c7da4ac..dc2bac5 100644 --- a/src/cowtest/main.c +++ b/src/cowtest/main.c @@ -1061,7 +1061,7 @@ bool randomWriteTest( char *mountedImagePath, char *normalImagePath, float minS off_t offset = rand() % maxOffset; size_t size = ( rand() + offset ) % RND_MAX_WRITE_SIZE; if ( size < RND_MAX_WRITE_SIZE / 2 ) { - size /= rand() % 8192; + size /= 1 + ( rand() % 8192 ); } size = MAX( size, 1 ); if ( r > RND_TRUNCATE_PROBABILITY + RND_UNALIGNED_WRITE_PROBABILITY ) { -- cgit v1.2.3-55-g7522