diff --git a/src/options.c b/src/options.c index 427e4e8..feef128 100644 --- a/src/options.c +++ b/src/options.c @@ -176,34 +176,36 @@ void line_pulse_duration_option_parse(const char *arg) char keyname[11]; unsigned int value; - if (sscanf(token, "%10[^=]=%d", keyname, &value) != 2) + if (sscanf(token, "%10[^=]=%d", keyname, &value) == 2) { - token_found = false; - } - - if (!strcmp(keyname, "DTR")) - { - option.dtr_pulse_duration = value; - } - else if (!strcmp(keyname, "RTS")) - { - option.rts_pulse_duration = value; - } - else if (!strcmp(keyname, "CTS")) - { - option.cts_pulse_duration = value; - } - else if (!strcmp(keyname, "DSR")) - { - option.dsr_pulse_duration = value; - } - else if (!strcmp(keyname, "DCD")) - { - option.dcd_pulse_duration = value; + if (!strcmp(keyname, "DTR")) + { + option.dtr_pulse_duration = value; + } + else if (!strcmp(keyname, "RTS")) + { + option.rts_pulse_duration = value; + } + else if (!strcmp(keyname, "CTS")) + { + option.cts_pulse_duration = value; + } + else if (!strcmp(keyname, "DSR")) + { + option.dsr_pulse_duration = value; + } + else if (!strcmp(keyname, "DCD")) + { + option.dcd_pulse_duration = value; + } + else if (!strcmp(keyname, "RI")) + { + option.ri_pulse_duration = value; + } } - else if (!strcmp(keyname, "RI")) + else { - option.ri_pulse_duration = value; + token_found = false; } } else