summaryrefslogtreecommitdiff
path: root/src/System/IO/MMap/Fixed.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/System/IO/MMap/Fixed.hs')
-rw-r--r--src/System/IO/MMap/Fixed.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/System/IO/MMap/Fixed.hs b/src/System/IO/MMap/Fixed.hs
index df6a6603..1e83c350 100644
--- a/src/System/IO/MMap/Fixed.hs
+++ b/src/System/IO/MMap/Fixed.hs
@@ -151,8 +151,8 @@ mallocTo fi s = do
151lookupRegion :: FixedOffset -> Fixed -> Maybe B.ByteString 151lookupRegion :: FixedOffset -> Fixed -> Maybe B.ByteString
152lookupRegion offset Fixed {..} = 152lookupRegion offset Fixed {..} =
153 case intersecting imap $ IntervalCO offset (succ offset) of 153 case intersecting imap $ IntervalCO offset (succ offset) of
154 [(i, (fptr, off))] -> let s = max 0 $ upperBound i - lowerBound i 154 [(i, (fptr, off))] -> let s = upperBound i - lowerBound i
155 in Just $ fromForeignPtr fptr off s 155 in Just $ fromForeignPtr fptr off (max 0 s)
156 _ -> Nothing 156 _ -> Nothing
157 157
158-- | Note: this is unsafe operation. 158-- | Note: this is unsafe operation.