Changeset 3ca0a2d in mainline for uspace/app/mkext4/mkext4.c


Ignore:
Timestamp:
2018-12-08T20:32:51Z (5 years ago)
Author:
Maurizio Lombardi <mlombard@…>
Parents:
9c3038d
Message:

mkext4: fix infinite loop when passing an invalid argument.

Also adds the —help parameter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkext4/mkext4.c

    r9c3038d r3ca0a2d  
    124124                }
    125125
     126                if (str_cmp(*argv, "--help") == 0) {
     127                        syntax_print();
     128                        return 0;
     129                }
     130
    126131                if (str_cmp(*argv, "-") == 0) {
    127132                        --argc;
    128133                        ++argv;
    129134                        break;
     135                } else {
     136                        printf(NAME ": Invalid argument: %s\n", *argv);
     137                        syntax_print();
     138                        return 1;
    130139                }
    131140        }
Note: See TracChangeset for help on using the changeset viewer.