diff --git a/mux.c b/mux.c index 1cfb914..1741efe 100644 --- a/mux.c +++ b/mux.c @@ -211,7 +211,7 @@ char *answerback; static void write_receive_buf(const unsigned char *buf, int len) { - if (!len) + if (len <= 0) return; write(STDOUT_FILENO, buf, len); @@ -306,7 +306,7 @@ static int handle_receive_buf(struct ios_ops *ios, unsigned char *buf, int len) unsigned char *sendbuf = buf; int i; - while (len) { + while (len > 0) { switch (*buf) { case IAC: /* BUG: this is telnet specific */