summaryrefslogtreecommitdiff
path: root/Command/FuzzTest.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-25 17:55:31 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-25 17:55:31 -0400
commit5574e612b21f9103d71cb51610710fbd8a6791d9 (patch)
tree682b782af563375885d799a85a0d876e8db722e3 /Command/FuzzTest.hs
parent626eabccef7a9a01ab1b2671c8c3b28f7baa96ce (diff)
fix
Diffstat (limited to 'Command/FuzzTest.hs')
-rw-r--r--Command/FuzzTest.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/FuzzTest.hs b/Command/FuzzTest.hs
index df54e90b0..29ee51ef2 100644
--- a/Command/FuzzTest.hs
+++ b/Command/FuzzTest.hs
@@ -222,11 +222,11 @@ existingFile n top = maybe (return Nothing) (go . toFilePath) =<< existingDir
if null dirs
then return Nothing
else do
- n <- getStdRandom $ randomR (0, length dirs - 1)
- existingFile (n - 1) (top </> dirs !! n)
+ i <- getStdRandom $ randomR (0, length dirs - 1)
+ existingFile (n - 1) (top </> dirs !! i)
else do
- n <- getStdRandom $ randomR (0, length files - 1)
- return $ Just $ FuzzFile $ top </> dir </> files !! n
+ i <- getStdRandom $ randomR (0, length files - 1)
+ return $ Just $ FuzzFile $ top </> dir </> files !! i
existingDir :: IO (Maybe FuzzDir)
existingDir = do