From b60882f2064e58c5e4cf98a2987e2d1022315ee4 Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 31 Jan 2014 15:42:20 +0000 Subject: [PATCH] Use putchar() instead of fputc() in uuencode(1) --- uuencode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uuencode.c b/uuencode.c index a400180..3b7a716 100644 --- a/uuencode.c +++ b/uuencode.c @@ -53,7 +53,7 @@ uuencode(FILE *fp, const char *name, const char *s) fprintf(stdout, "begin %o %s\n", st.st_mode & 0777, name); while ((n = fread(buf, 1, 45, fp))) { ch = ' ' + (n & 0x3f); - fputc(ch == ' ' ? '`' : ch, stdout); + putchar(ch == ' ' ? '`' : ch); for (p = buf; n > 0; n -= 3, p += 3) { if (n < 3) { p[2] = '\0'; @@ -61,15 +61,15 @@ uuencode(FILE *fp, const char *name, const char *s) p[1] = '\0'; } ch = ' ' + ((p[0] >> 2) & 0x3f); - fputc(ch == ' ' ? '`' : ch, stdout); + putchar(ch == ' ' ? '`' : ch); ch = ' ' + (((p[0] << 4) | ((p[1] >> 4) & 0xf)) & 0x3f); - fputc(ch == ' ' ? '`' : ch, stdout); + putchar(ch == ' ' ? '`' : ch); ch = ' ' + (((p[1] << 2) | ((p[2] >> 6) & 0x3)) & 0x3f); - fputc(ch == ' ' ? '`' : ch, stdout); + putchar(ch == ' ' ? '`' : ch); ch = ' ' + (p[2] & 0x3f); - fputc(ch == ' ' ? '`' : ch, stdout); + putchar(ch == ' ' ? '`' : ch); } - fputc('\n', stdout); + putchar('\n'); } if (ferror(fp)) eprintf("'%s' read error:", s);