summaryrefslogtreecommitdiff
path: root/usr.bin/write
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-10-29 10:33:26 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-10-29 10:33:26 +0000
commitb6c671c7bae5a8db43f20a4eca331bc4c7e0ff59 (patch)
tree620e53ebb39ba795af48ea4b06c9c2ebd24baf7c /usr.bin/write
parent3aab05cf23f5668d815f713b8dd3f660ec69e2fc (diff)
downloadsrc-test-b6c671c7bae5a8db43f20a4eca331bc4c7e0ff59.tar.gz
src-test-b6c671c7bae5a8db43f20a4eca331bc4c7e0ff59.zip
Remove char->int promotion.
Fix uncontrol function for 8bit chars.
Notes
Notes: svn path=/head/; revision=11916
Diffstat (limited to 'usr.bin/write')
-rw-r--r--usr.bin/write/write.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index a609cd24b7784..8bf8ab6fd7b4e 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -303,20 +303,18 @@ done()
wr_fputs(s)
register char *s;
{
- register char c;
#define PUTC(c) if (putchar(c) == EOF) goto err;
for (; *s != '\0'; ++s) {
- c = *s;
- if (c == '\n') {
+ if (*s == '\n') {
PUTC('\r');
PUTC('\n');
- } else if (!isprint(c) && !isspace(c) && c != '\007') {
+ } else if (!isprint(*s) && !isspace(*s) && *s != '\007') {
PUTC('^');
- PUTC(c^0x40); /* DEL to ?, others to alpha */
+ PUTC((*s^0x40)&~0x80); /* DEL to ?, others to alpha */
} else
- PUTC(c);
+ PUTC(*s);
}
return;