diff --git a/utils/dos33fs-utils/dos33.c b/utils/dos33fs-utils/dos33.c index 82c85c8e8..6840f218f 100644 --- a/utils/dos33fs-utils/dos33.c +++ b/utils/dos33fs-utils/dos33.c @@ -1063,26 +1063,21 @@ int main(int argc, char **argv) { int retval=0; /* Check command line arguments */ - while ((c = getopt(argc, argv, "a:l:t:s:dhvxy")) != -1) - { - switch (c) - { - - case 'd': - fprintf(stderr, "DEBUG enabled\n"); - debug = 1; - break; - case 'l': - length = strtol(optarg, &endptr, 0); - if (debug) - fprintf(stderr, "Length=%d\n", length); - break; - case 'a': - address = strtol(optarg, &endptr, 0); - if (debug) - fprintf(stderr, "Address=%d\n", address); - break; + while ((c = getopt (argc, argv,"a:l:t:s:dhvxy"))!=-1) { + switch (c) { + case 'd': + fprintf(stderr,"DEBUG enabled\n"); + debug=1; + break; + case 'a': + address=strtol(optarg,&endptr,0); + if (debug) fprintf(stderr,"Address=%d\n",address); + break; + case 'l': + length=strtol(optarg,&endptr,0); + if (debug) fprintf(stderr,"Length=%d\n",length); + break; #if 0 case 't': track=strtol(optarg,&endptr,0); @@ -1106,11 +1101,8 @@ int main(int argc, char **argv) { break; } } - for (c = 0; c < argc;c++) { - printf("+ argv[%d]=%s\n",c,argv[c]); - } - if (optind == argc) - { + + if (optind==argc) { fprintf(stderr,"ERROR! Must specify disk image!\n\n"); return -ERROR_INVALID_PARAMATER; } @@ -1133,7 +1125,6 @@ int main(int argc, char **argv) { retval=-ERROR_INVALID_PARAMATER; goto exit_and_close; } - printf("after next argument, optind=%d (%s) (command)\n", optind, argv[optind]); /* Grab command */ strncpy(temp_string,argv[optind],BUFSIZ-1); @@ -1145,7 +1136,6 @@ int main(int argc, char **argv) { /* Move to next argument */ optind++; - printf("after next argument, optind=%d (%s) [...]\n", optind, argv[optind]); command=lookup_command(temp_string); @@ -1266,22 +1256,20 @@ int main(int argc, char **argv) { case 'h': display_help(argv[0], 0); return 0; - case 'l': - length = strtol(optarg, &endptr, 0); - if (debug) - fprintf(stderr, "Length=%d\n", length); - break; case 'a': - address = strtol(optarg, &endptr, 0); - if (debug) - fprintf(stderr, "Address=%d\n", address); + address=strtol(optarg,&endptr,0); + if (debug) fprintf(stderr,"Address=%d\n",address); + break; + case 'l': + length=strtol(optarg,&endptr,0); + if (debug) fprintf(stderr,"Length=%d\n",length); break; } } } if (argc==optind) { - fprintf(stderr, "Error! local_file argument required\n"); + fprintf(stderr,"Error! local_file argument required\n"); if (command==COMMAND_BSAVE) { fprintf(stderr,"%s %s BSAVE "