diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-10-19 15:07:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-10-19 15:07:40 +0200 |
commit | 7f04124c149fa4d8e8f657907c581f10987003e2 (patch) | |
tree | d4f9c129f5ef7f4f28231766f449a12fb755b7e6 /common/console_countdown.c | |
parent | 71d764a4b05d3ca4ec8d14f71c9149fd0023424e (diff) | |
parent | 25c3fb28d8017595942115d4dbffc16d96f43930 (diff) | |
download | barebox-7f04124c149fa4d8e8f657907c581f10987003e2.tar.gz barebox-7f04124c149fa4d8e8f657907c581f10987003e2.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common/console_countdown.c')
-rw-r--r-- | common/console_countdown.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/console_countdown.c b/common/console_countdown.c index 03b9b33538..36da1ce577 100644 --- a/common/console_countdown.c +++ b/common/console_countdown.c @@ -47,12 +47,14 @@ int console_countdown(int timeout_s, unsigned flags, char *out_key) do { if (tstc()) { key = getchar(); - if (flags & CONSOLE_COUNTDOWN_ANYKEY) - goto out; - if (flags & CONSOLE_COUNTDOWN_RETURN && key == '\n') - goto out; - if (flags & CONSOLE_COUNTDOWN_CTRLC && key == 3) - goto out; + if (key >= 0) { + if (flags & CONSOLE_COUNTDOWN_ANYKEY) + goto out; + if (flags & CONSOLE_COUNTDOWN_RETURN && key == '\n') + goto out; + if (flags & CONSOLE_COUNTDOWN_CTRLC && key == 3) + goto out; + } key = 0; } if ((flags & CONSOLE_COUNTDOWN_EXTERN) && |