From: simon Date: Thu, 9 Sep 2010 14:32:25 +0000 (+0000) Subject: Cast incoming characters to unsigned char to avoid accidental sign X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/b96c714ea3802c22f3fe2659c121fd79ce28cbf2 Cast incoming characters to unsigned char to avoid accidental sign 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 --- diff --git a/ldisc.c b/ldisc.c index d57e6d17..f2853f4b 100644 --- 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) {