aboutsummaryrefslogtreecommitdiff
path: root/src/BTLS/Buffer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/BTLS/Buffer.hs')
-rw-r--r--src/BTLS/Buffer.hs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/BTLS/Buffer.hs b/src/BTLS/Buffer.hs
index 186054f..1a334e9 100644
--- a/src/BTLS/Buffer.hs
+++ b/src/BTLS/Buffer.hs
@@ -22,7 +22,6 @@ import qualified Data.ByteString as ByteString
import qualified Data.ByteString.Unsafe as ByteString
import Foreign (Ptr, castPtr)
import Foreign.C.Types
-import Unsafe.Coerce (unsafeCoerce)
unsafeUseAsCBuffer :: ByteString -> ((Ptr a, CULong) -> IO b) -> IO b
unsafeUseAsCBuffer bs f =
@@ -31,7 +30,4 @@ unsafeUseAsCBuffer bs f =
packCUStringLen :: Integral n => (Ptr CUChar, n) -> IO ByteString
packCUStringLen (pStr, len) =
- ByteString.packCStringLen (asCCharBuf pStr, fromIntegral len)
-
-asCCharBuf :: Ptr CUChar -> Ptr CChar
-asCCharBuf = unsafeCoerce
+ ByteString.packCStringLen (castPtr pStr, fromIntegral len)