summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2023-01-12 14:19:23 +0000
committerAdam Spragg <adam@spra.gg>2023-01-12 14:19:23 +0000
commitcd3b34aa2d31f2cdfcf6951cbd108fb0f5fa8732 (patch)
tree28132381339a789ff19787df775a445f1ae193e7
parent5073c9d007896eb822e21d49745459be22606ccc (diff)
Puzzle 22: Remove unneeded variable
Process command-line options by re-using a different variable than the one we were re-using before.
-rw-r--r--22.c5
1 files changed, 2 insertions, 3 deletions
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: