summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2023-01-12 13:45:17 +0000
committerAdam Spragg <adam@spra.gg>2023-01-12 14:03:20 +0000
commitfa82470db34f39f5c1f1df9e4524f727fbb819c2 (patch)
tree717cb00a5c7966d6b8165b67fde37b5025b9028a
parentdb6d1da86b80a545e0df38795ee869be57b8b89d (diff)
Puzzle 22: Use an `int` to hold the result of fgetc()
A char won't do.
-rw-r--r--22.c4
1 files 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) {