From 6c09add500b041b0a737a8c01a20d9df275660ea Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 1 Nov 2002 13:01:14 +0000 Subject: [PATCH] Another valgrind-caught error. This one has apparently been there 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telnet.c b/telnet.c index f20488e3..7e612cf6 100644 --- 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);