Skip to content

Commit

Permalink
fix corpus path for loading and saving (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrieco-tob authored Jan 24, 2023
1 parent 0010323 commit 3aa3e65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Echidna/Output/Corpus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import Data.ByteString qualified as BS
import Data.Hashable (hash)
import Data.Maybe (catMaybes)
import System.Directory (createDirectoryIfMissing, makeRelativeToCurrentDirectory, doesFileExist)
import System.FilePath ((</>), (<.>))

import Echidna.Types.Tx
import Echidna.Output.Utils

saveTxs :: FilePath -> [[Tx]] -> IO ()
saveTxs d = mapM_ saveTx where
saveTx v = do let fn = d ++ (show . hash . show) v ++ ".txt"
saveTx v = do let fn = d </> (show . hash . show) v <.> "txt"
b <- doesFileExist fn
unless b $ encodeFile fn (toJSON v)

Expand Down

0 comments on commit 3aa3e65

Please sign in to comment.