mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-22 14:17:27 +02:00
driver: Fix crashes on missing cli arguments
This commit is contained in:
+8
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user