From d5f464c7b384d10499512323801d95dafdd35d50 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 29 Apr 2020 12:35:14 +0300 Subject: [PATCH] refactoring --- fortune-mod/util/rot.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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; } -- 2.40.0