]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Another valgrind-caught error. This one has apparently been there
authorSimon Tatham <anakin@pobox.com>
Fri, 1 Nov 2002 13:01:14 +0000 (13:01 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 1 Nov 2002 13:01:14 +0000 (13:01 +0000)
since the Dawn O' Time, and consisted of me putting the two halves
of a short-circuiting bounds check the wrong way round: instead of
`p_in_range && *p', I had `*p && p_in_range'. Oops. valgrind rocks.

[originally from svn r2174]

telnet.c

index f20488e3428ea1b9bd73ff35a6230394c6cdf170..7e612cf6e6597539d82bb4dba75ba6f177588335 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);