Fix LE.i2osp 0

Little-endian bytes are stored at the beginning of the buffer.
This commit is contained in:
Olivier Chéron 2019-05-07 06:38:28 +02:00
parent 6893eae70a
commit 7ecb259aae

View File

@ -31,7 +31,7 @@ i2osp :: Integer -> Ptr Word8 -> Int -> IO Int
i2osp m ptr ptrSz
| ptrSz <= 0 = return 0
| m < 0 = return 0
| m == 0 = pokeByteOff ptr (sz-1) (0 :: Word8) >> return 1
| m == 0 = pokeByteOff ptr 0 (0 :: Word8) >> return 1
| ptrSz < sz = return 0
| otherwise = fillPtr ptr sz m >> return sz
where