From 17ca1e8e354572f68f0e369431fcfcf3249b93ae Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 17 Jan 2016 21:50:36 -0500 Subject: remember last login --- src/telnet.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/telnet.c') diff --git a/src/telnet.c b/src/telnet.c index 9e664ea..12c9533 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -46,7 +46,8 @@ int telnet_handle_command(const unsigned char *buf) { ECHO, "ECHO" }, { SGA, "SGA" }, { STATUS, "STATUS" }, - { NAWS, "NAWS" } + { NAWS, "NAWS" }, + { IP, "IP" }, }; for(unsigned int i = 0; i < ARRAYLEN(commands); ++i) @@ -55,16 +56,11 @@ int telnet_handle_command(const unsigned char *buf) { debugf("%s ", commands[i].name); cmd = true; + if(c == IP) + return TELNET_EXIT; goto found; } } - switch(c) - { - case IP: - return TELNET_EXIT; - default: - break; - } debugf("???: %d ", c); found: -- cgit v1.1