From: Shlomi Fish Date: Wed, 29 Apr 2020 09:35:14 +0000 (+0300) Subject: refactoring X-Git-Tag: fortune-mod-2.22.0~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5f464c7b384d10499512323801d95dafdd35d50;p=fortune-mod refactoring --- diff --git a/fortune-mod/util/rot.c b/fortune-mod/util/rot.c index 2f7e2ce..f13e933 100644 --- a/fortune-mod/util/rot.c +++ b/fortune-mod/util/rot.c @@ -1,20 +1,15 @@ -/* - * An extremely simpleminded function. Read characters from stdin, - * rot13 them, and put them on stdout. Totally unnecessary, of course. - */ - +// An extremely simpleminded function. Read characters from stdin, +// rot13 them, and put them on stdout. Totally unnecessary, of course. #include #include -#include int main(void) { int a; - while ((a = getchar()) != EOF) { putchar(isupper(a) ? ('A' + (a - 'A' + 13) % 26) : islower(a) ? ('a' + (a - 'a' + 13) % 26) : a); } - exit(0); + return 0; }