saltine 0.0.0.5 → 0.0.0.6
raw patch · 2 files changed
+5/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- saltine.cabal +1/−1
- src/Crypto/Saltine/Internal/Util.hs +4/−2
saltine.cabal view
@@ -1,5 +1,5 @@ name: saltine-version: 0.0.0.5+version: 0.0.0.6 synopsis: Cryptography that's easy to digest (NaCl/libsodium bindings). description:
src/Crypto/Saltine/Internal/Util.hs view
@@ -1,6 +1,7 @@ module Crypto.Saltine.Internal.Util where import Foreign.C+import Foreign.Marshal.Alloc (mallocBytes) import Foreign.Ptr import System.IO.Unsafe @@ -67,8 +68,9 @@ -- 'IO' monad. buildUnsafeCVector' :: Int -> (Ptr CChar -> IO b) -> IO (b, ByteString) buildUnsafeCVector' n k = do- let bs = S.replicate n 0- out <- unsafeUseAsCString bs k+ ph <- mallocBytes n+ bs <- unsafePackMallocCStringLen (ph, fromIntegral n)+ out <- unsafeUseAsCString bs k return (out, bs) -- | Extremely unsafe function, use with utmost care! Builds a new