mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-25 20:42:07 +00:00
xlink: replace awkward fatalerror() with standard errx(3)
fatalerror() prints a given string to stdout and exits(5). It cannot format text, so there was a string temptext used with sprintf() to format text and pass it to fatalerror(). errx() can format text, and it prints to stderr. As a bonus, this fixes the linking warnings from use of sprintf().
This commit is contained in:
@@ -19,7 +19,7 @@ SetMapfileName(char *name)
|
||||
mf = fopen(name, "wt");
|
||||
|
||||
if (!mf)
|
||||
fatalerror("Unable to open mapfile for writing");
|
||||
errx(5, "Unable to open mapfile for writing");
|
||||
}
|
||||
|
||||
void
|
||||
@@ -28,7 +28,7 @@ SetSymfileName(char *name)
|
||||
sf = fopen(name, "wt");
|
||||
|
||||
if (!sf)
|
||||
fatalerror("Unable to open symfile for writing");
|
||||
errx(5, "Unable to open symfile for writing");
|
||||
|
||||
fprintf(sf, ";File generated by xLink v" LINK_VERSION "\n\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user