]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Cast incoming characters to unsigned char to avoid accidental sign
authorSimon Tatham <anakin@pobox.com>
Thu, 9 Sep 2010 14:32:25 +0000 (14:32 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 9 Sep 2010 14:32:25 +0000 (14:32 +0000)
extension. Since ldisc_send() uses bit 8 as an internal flag, we
shouldn't be setting it except when we really want to.

[originally from svn r8989]

ldisc.c

diff --git a/ldisc.c b/ldisc.c
index d57e6d1740d3790642fdff3724b93122cceaf92c..f2853f4b303c4749e6a33a1e10b85e14767932ba 100644 (file)
--- a/ldisc.c
+++ b/ldisc.c
@@ -147,7 +147,7 @@ void ldisc_send(void *handle, char *buf, int len, int interactive)
     if (EDITING) {
        while (len--) {
            int c;
-           c = *buf++ + keyflag;
+           c = (unsigned char)(*buf++) + keyflag;
            if (!interactive && c == '\r')
                c += KCTRL('@');
            switch (ldisc->quotenext ? ' ' : c) {