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.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/BTLS/Buffer.hs b/src/BTLS/Buffer.hs
index 354c787..a74acf5 100644
--- a/src/BTLS/Buffer.hs
+++ b/src/BTLS/Buffer.hs
@@ -26,7 +26,8 @@ import qualified Data.ByteString.Unsafe as ByteString
import Foreign (Storable(peek), Ptr, alloca, allocaArray, castPtr)
import Foreign.C.Types
-unsafeUseAsCBuffer :: ByteString -> ((Ptr a, CULong) -> IO b) -> IO b
+unsafeUseAsCBuffer ::
+ Integral size => ByteString -> ((Ptr a, size) -> IO b) -> IO b
unsafeUseAsCBuffer bs f =
ByteString.unsafeUseAsCStringLen bs $ \(pStr, len) ->
f (castPtr pStr, fromIntegral len)