check for fopen() errors for output file
This commit is contained in:
parent
e91d121581
commit
55a1522b55
1 changed files with 6 additions and 1 deletions
7
main.c
7
main.c
|
@ -126,8 +126,13 @@ main(int ac, char *av[])
|
|||
}
|
||||
break;
|
||||
case 'o':
|
||||
if (strcmp(optarg, "-") != 0)
|
||||
if (strcmp(optarg, "-") != 0) {
|
||||
outf = fopen(optarg, "w");
|
||||
if (!outf) {
|
||||
fprintf(stderr, "cannot open '%s'\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
for (tm=tmap;; tm++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue