From dfd6c08655f7a0ac0e93e3227b0b54ef19a6df1f Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 14 Jan 2017 21:49:03 +0100 Subject: Check error conditions from tgetkey() --- manager.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/manager.cpp b/manager.cpp index 0bdd0a4..f2f9ab2 100644 --- a/manager.cpp +++ b/manager.cpp @@ -204,6 +204,16 @@ int Manager::io(){ redraw(); int key=tgetkey(); + if(key<0){ + cerr<<"Input read error: key="< ret=global_keyinput.input(key); if(ret.isLeft()){ @@ -250,6 +260,11 @@ Maybe Manager::promptString(const string &promptString){ redraw(); int key=tgetkey(); + if(key<0){ + cerr<<"Input read error in promptString: key="< ret=global_keyinput.input(key); if(ret.isLeft()){ @@ -286,6 +301,11 @@ char Manager::promptChar(const string &promptString,const string &options,char d while(true){ int key=tgetkey(); + if(key<0){ + cerr<<"Input read error in promptChar: key="<=127){ bel(); -- cgit v1.2.3-54-g00ecf