diff options
author | B. Watson <urchlay@slackware.uk> | 2024-12-23 04:29:07 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-12-23 04:29:07 -0500 |
commit | 1ca75efcaa18be049070220a40f921d7023c790e (patch) | |
tree | dc060a6cfa1cb577fc867e98c857cf46d8f3f336 /uxd.c | |
parent | 393c2d3eb63e3df852208eb217a2dc578d09a1dd (diff) | |
download | uxd-1ca75efcaa18be049070220a40f921d7023c790e.tar.gz |
rename optarg, optind to avoid possible link issues
Diffstat (limited to 'uxd.c')
-rw-r--r-- | uxd.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -35,8 +35,8 @@ on stderr. /* from getopt.c */ extern int my_getopt(int, char **, char *); -extern char *optarg; -extern int optind; +extern char *my_optarg; +extern int my_optind; #ifndef VERSION #define VERSION "(unknown version)" @@ -293,19 +293,19 @@ void parse_args(int argc, char **argv) { fprintf(stderr, "%s: multiple -d options not supported.\n", self); exit(1); } - dump_data_arg = optarg; break; + dump_data_arg = my_optarg; break; case '1': alternate_colors = 0; break; case 'i': print_info_opt = 1; break; case 'c': - mono = 0; parse_colors(optarg); break; + mono = 0; parse_colors(my_optarg); break; case 'n': break; /* already handled in parse_options() */ case 'b': bold = 1; break; case 'l': - limit = parse_number(opt, optarg); + limit = parse_number(opt, my_optarg); if(limit < 0) { fprintf(stderr, "%s: negative limit for -l not allowed.\n", self); exit(1); @@ -316,12 +316,12 @@ void parse_args(int argc, char **argv) { case 'm': mono = 1; break; case 'o': - display_offset = parse_number(opt, optarg); break; + display_offset = parse_number(opt, my_optarg); break; case 'S': seek_offset_zero = 1; /* fall thru */ case 's': - seekpos = parse_number(opt, optarg); + seekpos = parse_number(opt, my_optarg); break; case 'u': hex_byte_fmt = UC_BYTE_FMT; hex_addr_fmt = UC_ADDR_FMT; break; @@ -335,16 +335,16 @@ void parse_args(int argc, char **argv) { } if(dump_data_arg) { - if(optind != argc) { + if(my_optind != argc) { fprintf(stderr, "%s: cannot give a filename when -d is used.\n", self); exit(1); } } else { /* filename (if present) must come after all -options, and there can only be one filename. */ - if(optind < (argc - 1)) usage(); + if(my_optind < (argc - 1)) usage(); - open_input(argv[optind]); + open_input(argv[my_optind]); } } |