diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-07-25 18:22:07 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-07-25 18:22:07 -0700 |
commit | 80ff833dd8ad011b579bff26ac654819e6735bce (patch) | |
tree | 14f667ebb4739fd60780890884b98ce43e6b2e74 /config.c | |
parent | 7406c8bf64624feff0bf982e4667a194d31f8484 (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 'config.c')
-rw-r--r-- | config.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -53,8 +53,7 @@ tern_node * parse_config_int(char **state, int started, int *line) if (started) { return head; } - fprintf(stderr, "unexpected } on line %d\n", *line); - exit(1); + fatal_error("unexpected } on line %d\n", *line); } char * end = curline + len - 1; @@ -133,7 +132,8 @@ success: return ret; } no_config: - fputs("Failed to find a config file in ~/.config/blastem/blastem.cfg or in the blastem executable directory\n", stderr); - exit(1); + fatal_error("Failed to find a config file in ~/.config/blastem/blastem.cfg or in the blastem executable directory\n"); + //this will never get reached, but the compiler doesn't know that. Let's make it happy + return NULL; } |