summaryrefslogtreecommitdiffstats
path: root/lib/libedit/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libedit/key.c')
-rw-r--r--lib/libedit/key.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libedit/key.c b/lib/libedit/key.c
index a84f413..3da65d5 100644
--- a/lib/libedit/key.c
+++ b/lib/libedit/key.c
@@ -640,7 +640,7 @@ key__decode_char(buf, cnt, ch)
char *buf;
int cnt, ch;
{
- ch &= 0xFF;
+ ch = (unsigned char)ch;
if (ch == 0) {
buf[cnt++] = '^';
@@ -650,10 +650,10 @@ key__decode_char(buf, cnt, ch)
if (iscntrl(ch)) {
buf[cnt++] = '^';
- if (ch == '\177')
+ if (ch == 0177)
buf[cnt] = '?';
else
- buf[cnt] = ch | 0100;
+ buf[cnt] = toascii(ch) | 0100;
}
else if (ch == '^') {
buf[cnt++] = '\\';
@@ -704,7 +704,7 @@ key__decode_str(str, buf, sep)
if (*p == '\177')
*b++ = '?';
else
- *b++ = *p | 0100;
+ *b++ = toascii(*p) | 0100;
}
else if (*p == '^' || *p == '\\') {
*b++ = '\\';
OpenPOWER on IntegriCloud