From bd03b9baa6c25fed35c12d3cc9b843a037c23bdf Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Tue, 15 Oct 2019 15:57:46 -0400 Subject: Fix 32/64-bit bug. --- lib/KeyDB.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/KeyDB.hs b/lib/KeyDB.hs index c92f614..fd0a9ce 100644 --- a/lib/KeyDB.hs +++ b/lib/KeyDB.hs @@ -71,7 +71,11 @@ newtype KeyGrip = KeyInt Int fingerprintGrip :: Fingerprint -> KeyGrip fingerprintGrip (Fingerprint bs) = - case decode $ L.fromStrict $ S.drop (S.length bs - sizeOf (0::Int)) bs of + -- case decode $ L.fromStrict $ S.drop (S.length bs - sizeOf (0::Int)) bs of + -- -- The above was removed because Int is encoded as 8 bytes even when we are + -- -- using 32-bit GHC. + -- Presumably, the extra 4 bytes will be truncated. + case decode $ L.fromStrict $ S.drop (S.length bs - 8) bs of i -> KeyInt i smallprGrip :: String -> Maybe KeyGrip -- cgit v1.2.3