From b96c714ea3802c22f3fe2659c121fd79ce28cbf2 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 9 Sep 2010 14:32:25 +0000 Subject: [PATCH] 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 --- ldisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.11.0