fix initialize pointer

This commit is contained in:
Hideyuki Tanaka 2010-05-30 17:19:43 +09:00
parent 6b5b76b0c9
commit d43921823e

View File

@ -560,6 +560,7 @@ unpackObject z dat =
allocaBytes (#size msgpack_object) $ \ptr -> allocaBytes (#size msgpack_object) $ \ptr ->
BS.useAsCStringLen dat $ \(str, len) -> BS.useAsCStringLen dat $ \(str, len) ->
alloca $ \poff -> do alloca $ \poff -> do
poke poff 0
ret <- msgpack_unpack str (fromIntegral len) poff z ptr ret <- msgpack_unpack str (fromIntegral len) poff z ptr
case ret of case ret of
(#const MSGPACK_UNPACK_SUCCESS) -> do (#const MSGPACK_UNPACK_SUCCESS) -> do