summaryrefslogtreecommitdiffhomepage
path: root/UI
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-19 16:41:58 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-19 16:41:58 -0400
commitd25d55c9c68263100ea21e66eda74067cc8c1393 (patch)
treec6ad47e68fab261103755e8e6647f0d614f48cee /UI
parent0afe2e6177b48078db381d26334d3f4fd13363da (diff)
downloadkeysafe-d25d55c9c68263100ea21e66eda74067cc8c1393.tar.gz
fix 2 fencepost errors!
Diffstat (limited to 'UI')
-rw-r--r--UI/Readline.hs4
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