fixed short options

This commit is contained in:
Devaev Maxim
2019-09-12 03:00:13 +03:00
parent 5d270b0029
commit f3339f0502

View File

@@ -263,10 +263,10 @@ int parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t
if (isalpha(_LONG_OPTS[opt_index].val)) {
short_opts[short_index] = _LONG_OPTS[opt_index].val;
++short_index;
}
if (_LONG_OPTS[opt_index].has_arg == required_argument) {
short_opts[short_index] = ':';
++short_index;
if (_LONG_OPTS[opt_index].has_arg == required_argument) {
short_opts[short_index] = ':';
++short_index;
}
}
}