diff options
author | Joe Crayne <joe@jerkface.net> | 2019-10-15 15:57:46 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-10-15 15:57:46 -0400 |
commit | bd03b9baa6c25fed35c12d3cc9b843a037c23bdf (patch) | |
tree | 041da25cc0f044d5ab92af673e8c391f2116c28e /lib/KeyDB.hs | |
parent | f72cf2344c4f7486a1a7a12a423ec85e5cb4b539 (diff) |
Fix 32/64-bit bug.
Diffstat (limited to 'lib/KeyDB.hs')
-rw-r--r-- | lib/KeyDB.hs | 6 |
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 | ||
72 | fingerprintGrip :: Fingerprint -> KeyGrip | 72 | fingerprintGrip :: Fingerprint -> KeyGrip |
73 | fingerprintGrip (Fingerprint bs) = | 73 | fingerprintGrip (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 | ||
77 | smallprGrip :: String -> Maybe KeyGrip | 81 | smallprGrip :: String -> Maybe KeyGrip |