summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-06-05 17:59:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-06-05 17:59:26 +0200
commitafc6a6a6c1839ad11d34d241656545ea6497a11f (patch)
tree1e056daf3d598a5ae7983b504df44c24769d7702
parentFix reuse sock issues. (diff)
downloadtelnet-password-honeypot-afc6a6a6c1839ad11d34d241656545ea6497a11f.tar.xz
telnet-password-honeypot-afc6a6a6c1839ad11d34d241656545ea6497a11f.zip
Check for 0xff before control char.
-rw-r--r--honeypot.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/honeypot.c b/honeypot.c
index 182833c..be8f77f 100644
--- a/honeypot.c
+++ b/honeypot.c
@@ -176,11 +176,12 @@ void readline(char *buffer, size_t size, int password)
i -= 2;
continue;
}
- } else if (iscntrl(c)) {
- --i;
- continue;
} else if (c == 0xff)
_exit(EXIT_SUCCESS);
+ else if (iscntrl(c)) {
+ --i;
+ continue;
+ }
buffer[i] = c;
putc(password ? '*' : c, output);
fflush(output);