diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-19 16:41:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-19 16:41:58 -0400 |
commit | d25d55c9c68263100ea21e66eda74067cc8c1393 (patch) | |
tree | c6ad47e68fab261103755e8e6647f0d614f48cee /UI | |
parent | 0afe2e6177b48078db381d26334d3f4fd13363da (diff) | |
download | keysafe-d25d55c9c68263100ea21e66eda74067cc8c1393.tar.gz |
fix 2 fencepost errors!
Diffstat (limited to 'UI')
-rw-r--r-- | UI/Readline.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/UI/Readline.hs b/UI/Readline.hs index 668c023..0f852ea 100644 --- a/UI/Readline.hs +++ b/UI/Readline.hs @@ -140,9 +140,9 @@ myPromptKeyId title desc l = do putStrLn "" case readMaybe r of Just n - | n > 0 && n < length l -> do + | n > 0 && n <= length l -> do putStrLn "" - return $ Just $ snd (l !! n) + return $ Just $ snd (l !! pred n) _ -> do putStrLn $ "Enter a number from 1 to " ++ show (length l) prompt |