From 973e27b243ea7f12b6743894465c67a4a6a87eb2 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Sat, 6 Sep 2025 09:26:21 +0200 Subject: Move some other code here Signed-off-by: Carlos Maiolino --- C/HF/chap4/cryptic/ecat.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 C/HF/chap4/cryptic/ecat.c (limited to 'C/HF/chap4/cryptic/ecat.c') diff --git a/C/HF/chap4/cryptic/ecat.c b/C/HF/chap4/cryptic/ecat.c new file mode 100644 index 0000000..5266116 --- /dev/null +++ b/C/HF/chap4/cryptic/ecat.c @@ -0,0 +1,23 @@ +#include +#include "encrypt.h" + +int main(int argc, char **argv) +{ + FILE *fd; + char buf[80]; + + if (argc != 2) + return 1; + + fd = fopen(argv[1], "r"); + + while (fgets(buf, 80, fd)) { + encrypt(buf); + printf("%s", buf); + } + + printf("\n"); + fclose(fd); + + return 0; +} -- cgit v1.2.3