summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-10-15 15:57:46 -0400
committerJoe Crayne <joe@jerkface.net>2019-10-15 15:57:46 -0400
commitbd03b9baa6c25fed35c12d3cc9b843a037c23bdf (patch)
tree041da25cc0f044d5ab92af673e8c391f2116c28e
parentf72cf2344c4f7486a1a7a12a423ec85e5cb4b539 (diff)
Fix 32/64-bit bug.
-rw-r--r--lib/KeyDB.hs6
1 files changed, 5 insertions, 1 deletions
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
71 71
72fingerprintGrip :: Fingerprint -> KeyGrip 72fingerprintGrip :: Fingerprint -> KeyGrip
73fingerprintGrip (Fingerprint bs) = 73fingerprintGrip (Fingerprint bs) =
74 case decode $ L.fromStrict $ S.drop (S.length bs - sizeOf (0::Int)) bs of 74 -- case decode $ L.fromStrict $ S.drop (S.length bs - sizeOf (0::Int)) bs of
75 -- -- The above was removed because Int is encoded as 8 bytes even when we are
76 -- -- using 32-bit GHC.
77 -- Presumably, the extra 4 bytes will be truncated.
78 case decode $ L.fromStrict $ S.drop (S.length bs - 8) bs of
75 i -> KeyInt i 79 i -> KeyInt i
76 80
77smallprGrip :: String -> Maybe KeyGrip 81smallprGrip :: String -> Maybe KeyGrip