Cleanup: move the "no key ready" state into the switch().
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/ifstats.c | 35 ++++++++++++++++++-----------------
1 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/src/ifstats.c b/src/ifstats.c
index d516585..1fa2dc5 100644
--- a/src/ifstats.c
+++ b/src/ifstats.c
@@ -990,23 +990,24 @@ void detstats(char *iface, const struct OPTIONS *options, int
facilitytime,
getpacket(fd, buf, &fromaddr, &ch, &br, ifname, statwin);
- if (ch != ERR) {
- switch (ch) {
- case 12:
- case 'l':
- case 'L':
- tx_refresh_screen();
- break;
-
- case 'Q':
- case 'q':
- case 'X':
- case 'x':
- case 24:
- case 27:
- exitloop = 1;
- break;
- }
+ switch (ch) {
+ case ERR:
+ /* no key ready, do nothing */
+ break;
+ case 12:
+ case 'l':
+ case 'L':
+ tx_refresh_screen();
+ break;
+
+ case 'Q':
+ case 'q':
+ case 'X':
+ case 'x':
+ case 24:
+ case 27:
+ exitloop = 1;
+ break;
}
if (br > 0) {
framelen = br;
--
1.7.8.4