From cd3b34aa2d31f2cdfcf6951cbd108fb0f5fa8732 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Thu, 12 Jan 2023 14:19:23 +0000 Subject: Puzzle 22: Remove unneeded variable Process command-line options by re-using a different variable than the one we were re-using before. --- 22.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '22.c') diff --git a/22.c b/22.c index db4ee87..180969f 100644 --- a/22.c +++ b/22.c @@ -230,13 +230,12 @@ main(int argc, char ** argv) struct map map; enum map_type mtype = M_FLAT; long bufsiz = 0, buflen = 0; - long pos; struct elf elf; char distance[8]; int c, dlen = 0; - while ((pos = getopt(argc, argv, "p:m:")) != -1) { - switch (pos) { + while ((c = getopt(argc, argv, "p:m:")) != -1) { + switch (c) { case 'p': switch (atoi(optarg)) { case 1: -- cgit v1.2.1