Skip to content
Browse files

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
  • Loading branch information...
1 parent 854caca commit b96c714ea3802c22f3fe2659c121fd79ce28cbf2 simon committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 ldisc.c
View
2 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) {

0 comments on commit b96c714

Please sign in to comment.
Something went wrong with that request. Please try again.