mirror of https://github.com/YosysHQ/yosys.git
driver: Fix crashes on missing cli arguments
This commit is contained in:
parent
46838172c2
commit
54a97f8bb7
|
@ -92,8 +92,15 @@ int getopt(int argc, char **argv, const char *optstring)
|
|||
return optopt;
|
||||
}
|
||||
|
||||
optarg = argv[++optind];
|
||||
if (++optind >= argc) {
|
||||
fprintf(stderr, "%s: option '-%c' expects an argument\n", argv[0], optopt);
|
||||
optopt = '?';
|
||||
return optopt;
|
||||
}
|
||||
|
||||
optarg = argv[optind];
|
||||
optind++, optcur = 1;
|
||||
|
||||
return optopt;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue