]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_boot.c
reset optind before executing command
[z180-stamp.git] / avr / cmd_boot.c
index e26a8b1b3340226aa0730bd871a9a653a49b575a..dcf834d7532eef4f667ecbcf92ddc653f11c1444 100644 (file)
@@ -106,9 +106,6 @@ command_ret_t do_bootcf(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int a
        memcpy_P(&boot_param, cfboot, sizeof boot_param);
        default_stages = boot_param.stages;
 
-       /* reset getopt() */
-       optind = 0;
-
        int opt;
        while ((opt = getopt(argc, argv, PSTR("vna:s:c:t:i:"))) != -1) {
                switch (opt) {
@@ -256,9 +253,6 @@ command_ret_t do_go(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc,
        uint32_t addr;
        bool hold = 0;
 
-       /* reset getopt() */
-       optind = 0;
-
        int opt;
        while ((opt = getopt(argc, argv, PSTR("h"))) != -1) {
                switch (opt) {