partially fix segfault when run with options but no input file

(caused by fclose()-ing an unopened file)
This commit is contained in:
anthony
2009-12-30 00:08:25 -07:00
parent 5e9c2ee2ab
commit e5ac9c2cd8

View File

@@ -167,8 +167,7 @@ int main(int argc, char *argv[])
strcat(filename, ".gb");
f = fopen(filename, "rb+");
if (!f)
FatalError("Unable to open file");
if( (f=fopen(filename,"rb+"))!=NULL ) {
/*
* -d (Debug) option code
@@ -464,6 +463,9 @@ int main(int argc, char *argv[])
}
fclose(f);
} else {
FatalError("File '%s' not found",filename);
}
return (0);
}