From fa82470db34f39f5c1f1df9e4524f727fbb819c2 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Thu, 12 Jan 2023 13:45:17 +0000 Subject: Puzzle 22: Use an `int` to hold the result of fgetc() A char won't do. --- 22.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/22.c b/22.c index 9da3e6d..a4a687f 100644 --- a/22.c +++ b/22.c @@ -152,8 +152,8 @@ main(int argc, char ** argv) long bufsiz = 0, buflen = 0, maxline = 0, lines = 0; long pos; struct elf elf; - char distance[8], c; - int dlen = 0; + char distance[8]; + int c, dlen = 0; while ((pos = getopt(argc, argv, "p:m:")) != -1) { switch (pos) { -- cgit v1.2.1