sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit b60882f2064e58c5e4cf98a2987e2d1022315ee4
parent aab53ef1972ca149f5e0371539d78d17ec89e3f5
Author: sin <sin@2f30.org>
Date:   Fri, 31 Jan 2014 15:42:20 +0000

Use putchar() instead of fputc() in uuencode(1)

Diffstat:
Muuencode.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 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);