From 03ed9147147c5858a667eeea34e10e2e6a4358d9 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Fri, 14 Feb 2020 00:29:24 +0100 Subject: [PATCH] Give reason to why writing the object file fails --- src/asm/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/asm/output.c b/src/asm/output.c index 77bcd53a..04d9a7ed 100644 --- a/src/asm/output.c +++ b/src/asm/output.c @@ -425,8 +425,8 @@ void out_WriteObject(void) addexports(); f = fopen(tzObjectname, "wb"); - if (f == NULL) - fatalerror("Couldn't write file '%s'\n", tzObjectname); + if (!f) + err(1, "Couldn't write file '%s'", tzObjectname); fprintf(f, RGBDS_OBJECT_VERSION_STRING, RGBDS_OBJECT_VERSION_NUMBER); fputlong(RGBDS_OBJECT_REV, f);