Another valgrind-caught error. This one has apparently been there
[sgt/putty] / telnet.c
index f20488e..7e612cf 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -742,7 +742,7 @@ static int telnet_send(void *handle, char *buf, int len)
     while (p < buf + len) {
        char *q = p;
 
-       while (iswritable((unsigned char) *p) && p < buf + len)
+       while (p < buf + len && iswritable((unsigned char) *p))
            p++;
        telnet->bufsize = sk_write(telnet->s, q, p - q);