diff options
author | ache <ache@FreeBSD.org> | 1997-06-27 11:50:56 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-06-27 11:50:56 +0000 |
commit | 21e75aae3104eb74e54c62aaf5c810755d92d17e (patch) | |
tree | c115335d4586e736fda1900f600c892e54c4a7db /lib/libedit/key.c | |
parent | 189c9c5d470c401df32c18a99d4ce6ae09571f19 (diff) | |
download | FreeBSD-src-21e75aae3104eb74e54c62aaf5c810755d92d17e.zip FreeBSD-src-21e75aae3104eb74e54c62aaf5c810755d92d17e.tar.gz |
ctype: portability, sign extension and cleanup fixes
Diffstat (limited to 'lib/libedit/key.c')
-rw-r--r-- | lib/libedit/key.c | 8 |
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++ = '\\'; |