mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
check for fopen() errors for output file
This commit is contained in:
parent
e91d121581
commit
55a1522b55
7
main.c
7
main.c
@ -126,8 +126,13 @@ main(int ac, char *av[])
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (strcmp(optarg, "-") != 0)
|
if (strcmp(optarg, "-") != 0) {
|
||||||
outf = fopen(optarg, "w");
|
outf = fopen(optarg, "w");
|
||||||
|
if (!outf) {
|
||||||
|
fprintf(stderr, "cannot open '%s'\n", optarg);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
for (tm=tmap;; tm++) {
|
for (tm=tmap;; tm++) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user