summaryrefslogtreecommitdiff
path: root/stateview.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-07-25 18:22:07 -0700
committerMichael Pavone <pavone@retrodev.com>2015-07-25 18:22:07 -0700
commit80ff833dd8ad011b579bff26ac654819e6735bce (patch)
tree14f667ebb4739fd60780890884b98ce43e6b2e74 /stateview.c
parent7406c8bf64624feff0bf982e4667a194d31f8484 (diff)
Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
Diffstat (limited to 'stateview.c')
-rw-r--r--stateview.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/stateview.c b/stateview.c
index 751d2af..1e8632f 100644
--- a/stateview.c
+++ b/stateview.c
@@ -61,13 +61,11 @@ int headless = 0;
int main(int argc, char ** argv)
{
if (argc < 2) {
- fprintf(stderr, "Usage: stateview FILENAME\n");
- exit(1);
+ fatal_error("Usage: stateview FILENAME\n");
}
FILE * state_file = fopen(argv[1], "rb");
if (!state_file) {
- fprintf(stderr, "Failed to open %s\n", argv[1]);
- exit(1);
+ fatal_error("Failed to open %s\n", argv[1]);
}
config = load_config(argv[0]);
int width = -1;