From f0cafc464defe251540da8583acef38fe72c8dc2 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 29 Oct 1995 10:33:26 +0000 Subject: Remove char->int promotion. Fix uncontrol function for 8bit chars. --- usr.bin/write/write.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index a609cd2..8bf8ab6 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; -- cgit v1.1