on master help sign in
Fix bounds check in copy code
2d7ca1dBryan O'Sullivan
Data/Text/Fusion.hs+1−1
@@ -168,7 +168,7 @@ copy src dest = copy_loop 0
168 where
168 where
169 len = A.length src
169 len = A.length src
170 copy_loop i
170 copy_loop i
171− | i > len = return ()
171+ | i >= len = return ()
172 | otherwise = do A.unsafeRead src i >>= A.unsafeWrite dest i
172 | otherwise = do A.unsafeRead src i >>= A.unsafeWrite dest i
173 copy_loop (i+1)
173 copy_loop (i+1)
174
174