xftp: fix file reception on 32 bit platforms (#708)

This commit is contained in:
Evgeny Poberezkin
2023-04-06 20:40:52 +01:00
committed by GitHub
parent 9f8db13553
commit b1489138ea
5 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -139,7 +139,7 @@ newtype InfoOptions = InfoOptions
data RandomFileOptions = RandomFileOptions
{ filePath :: FilePath,
fileSize :: FileSize Int
fileSize :: FileSize Int64
}
deriving (Show)
@@ -586,7 +586,7 @@ cliRandomFile RandomFileOptions {filePath, fileSize = FileSize size} = do
putStrLn $ "File created: " <> filePath
where
saveRandomFile h sz = do
bytes <- getRandomBytes $ min mb' sz
bytes <- getRandomBytes $ fromIntegral $ min mb' sz
B.hPut h bytes
when (sz > mb') $ saveRandomFile h (sz - mb')
mb' = mb 1