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 /gen.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 'gen.c')
-rw-r--r-- | gen.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2,14 +2,14 @@ #include <stdlib.h> #include "gen.h" #include "mem.h" +#include "util.h" void init_code_info(code_info *code) { size_t size = CODE_ALLOC_SIZE; code->cur = alloc_code(&size); if (!code->cur) { - fputs("Failed to allocate memory for generated code\n", stderr); - exit(1); + fatal_error("Failed to allocate memory for generated code\n"); } code->last = code->cur + size/sizeof(code_word) - RESERVE_WORDS; } |