Cast incoming characters to unsigned char to avoid accidental sign
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 9 Sep 2010 14:32:25 +0000 (14:32 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
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.

git-svn-id: svn://svn.tartarus.org/sgt/putty@8989 cda61777-01e9-0310-a592-d414129be87e

ldisc.c

diff --git a/ldisc.c b/ldisc.c
index d57e6d1..f2853f4 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) {