Commit e432da9f authored by qrczak's avatar qrczak

[project @ 2001-08-15 09:54:38 by qrczak]

Fix peekArray for size==0.
parent c5467fbf
% -----------------------------------------------------------------------------
% $Id: PrelMarshalArray.lhs,v 1.7 2001/08/15 09:28:58 simonmar Exp $
% $Id: PrelMarshalArray.lhs,v 1.8 2001/08/15 09:54:38 qrczak Exp $
%
% (c) The FFI task force, 2000
%
......@@ -126,7 +126,7 @@ reallocArray0 ptr size = reallocArray ptr (size + 1)
-- needed linear stack space.
--
peekArray :: Storable a => Int -> Ptr a -> IO [a]
peekArray size ptr | size < 0 = return []
peekArray size ptr | size <= 0 = return []
| otherwise = f (size-1) []
where
f 0 acc = do e <- peekElemOff ptr 0; return (e:acc)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment